From patchwork Fri Feb 3 12:23:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9554033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61C87602B7 for ; Fri, 3 Feb 2017 12:24:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50EC0284D2 for ; Fri, 3 Feb 2017 12:24:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 438BF284DC; Fri, 3 Feb 2017 12:24:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFC69284D2 for ; Fri, 3 Feb 2017 12:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbdBCMYo (ORCPT ); Fri, 3 Feb 2017 07:24:44 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35748 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbdBCMYn (ORCPT ); Fri, 3 Feb 2017 07:24:43 -0500 Received: by mail-pf0-f196.google.com with SMTP id f144so1505442pfa.2; Fri, 03 Feb 2017 04:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1nHdMJNg0FBEqxkCbnnE4P1KRIQQ0kxjXCwMjrA/1fw=; b=QXppN2x8BPEsWYoIWYGVR/UjAdm42NKrY2wMifVmnicGhTwHf/8jkmGzCnawUO+izC NfaMEHShjQcVmvv7c4QdWrgmHJZAC+x0qbu1zoWteKJpKB002EnMtY8K2dkfYww9IprI lzXVqH4/TvTTr3pfKYnR7PVbZMb+UKwj6qLGjL4oHgSeraUwYlheHzQl/T/Mhj4NuuT7 bmgbt7rtYWZxkLyAE0hoHi7ZSvYeJpU2jRptO6lj323yAqcRN4GN6jrMp6PYO/XtLWKt E7K8n/Ui1j2sQkq/Cc8OOm+uazb0cG1KLgvRlBcn57V+/FyYNWOhQUKbvWoZjyu68lDp 5PGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1nHdMJNg0FBEqxkCbnnE4P1KRIQQ0kxjXCwMjrA/1fw=; b=J31JJPXheFPXr8lJx7Qn1YVMsjv2ggXh9qcZuiYtJ3ZXBY2zuUc2TCQYeqYnwjbMZq RxDpLP7yfRahZPezGZePL7mcvjF6NwTt6DskKd7oJgwulW/Boh9km168c4hPZQdtDS6v GZ3nQfYZa2iUoeLfGM9mqc+cG3WcMXlDJIJCT1GjQvdFMx0BoaHFeug1cf9utSaShZ37 OIUjyTECDRWlEKDonoH47puZIyPkz8+m/FJ9ylVDY2xinORqQeGpxIc04k2p3ao1+skJ sqNDET8O2N8HG0CdsT/fJZb5KGm9OLIvlmWnZTgx1I+oqSt55PrUx2HOZrSjChhOx0Pc 7NbQ== X-Gm-Message-State: AIkVDXLB1pjwlKY8GVckwDZzdiXMku/VjAP3K0cAq2ceYv6SgtG1HmGxrgq/l5ssOFNcFA== X-Received: by 10.98.21.131 with SMTP id 125mr17522272pfv.110.1486124682649; Fri, 03 Feb 2017 04:24:42 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id a1sm5257378pgc.14.2017.02.03.04.24.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 04:24:41 -0800 (PST) From: Arvind Yadav To: tomi.valkeinen@ti.com, b.zolnierkie@samsung.com Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] omapfb: dss: Handle return error in dss_init_ports. Date: Fri, 3 Feb 2017 17:53:45 +0530 Message-Id: <1486124625-23454-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here, dss_init_ports is not handling return error form dpi_init_port and sdi_init_port. Now dss_init_ports is returning always 0. And it's making below code as a dead code. static int dss_bind(struct device *dev) { . . r = dss_init_ports(pdev); //dss_init_ports will return always 0 if (r)// This condition will always false goto err_init_ports; //Dead Code . . } This change is to handle return error from dpi_init_port and sdi_init_port. Also, It will remove dead code from function 'dss_bind'. Signed-off-by: Arvind Yadav --- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index 47d7f69..15a0dab 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -946,6 +946,7 @@ static int dss_init_ports(struct platform_device *pdev) struct device_node *parent = pdev->dev.of_node; struct device_node *port; int r; + int ret = 0; if (parent == NULL) return 0; @@ -972,17 +973,17 @@ static int dss_init_ports(struct platform_device *pdev) switch (port_type) { case OMAP_DISPLAY_TYPE_DPI: - dpi_init_port(pdev, port); + ret = dpi_init_port(pdev, port); break; case OMAP_DISPLAY_TYPE_SDI: - sdi_init_port(pdev, port); + ret = sdi_init_port(pdev, port); break; default: break; } } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); - return 0; + return ret; } static void dss_uninit_ports(struct platform_device *pdev)