From patchwork Thu Feb 9 09:58:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9564311 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 89D49601C3 for ; Thu, 9 Feb 2017 09:59:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62761284EB for ; Thu, 9 Feb 2017 09:59:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55FB22851D; Thu, 9 Feb 2017 09:59:22 +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 F2D05284EB for ; Thu, 9 Feb 2017 09:59:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999AbdBIJ7V (ORCPT ); Thu, 9 Feb 2017 04:59:21 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:32943 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673AbdBIJ7T (ORCPT ); Thu, 9 Feb 2017 04:59:19 -0500 Received: by mail-pg0-f65.google.com with SMTP id 194so17543400pgd.0; Thu, 09 Feb 2017 01:59:14 -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=iOERgYqAKz9Hb5sXzbLiG+BMvolvXXqsUAEOVY9/xD0=; b=gFEPBClqj0bOev4aot3SvnDCN97fEGaf/faWNw2WFaJfHe1Nm52sgWGOV8kXVCbAzs JxJZbZdMtthYAuqh7DY1YVbbY2vdH4QgaW6kDycgUOl+7srh6BSkW2x+2C76flBRtlks euuQQfPqgNZS5/imRhOU6CbSIbKBV3qaUBTfMH7Nnl+tZDTh+mZHImEEJ8cHAkvlvRhc MLfxWi3/mJeu9pICneeeiYzl4smHDOcw+iJ/vmWLxVfJ15PCmQlC/N8EnJ8cknA9Bw8O L7/voZfORPjfiL1XNTY8nFPdkQs3D+qyZJtMqBa+AFVtjEJ3d1as/UWPL3eM9wP6MLbt kY0A== 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=iOERgYqAKz9Hb5sXzbLiG+BMvolvXXqsUAEOVY9/xD0=; b=E8BfqR1khg8HQzBTowcGYUlrFwCbo1ORdVfEVQotDUnHcgPWSS3hCl4Jb2Gc7DlOfN ewOXZHhbxkRf47COBtRWtIDtXPTPn42Ur3xcKQqFidwqg2jSCxQLc7sbkvM4Ta/dFcnk NhWMvpOwQ9ufM6jD8GAbmA4l3/7Ci9Pr0zd8lZryft+1RyvfHvJL17210sxHJgsjLqAm rMRpi2DPq1yquJdBY4sokNTmHTgce0A8OBJDLv8lxC+zaTF00HCKj5G3G39ZZIYtZfUR igKW9F4/e48a2XfE8ScyCZw0ywtfliaMe4y41vmfjRg54V5aXkiqdXJd7/vpxCgZQggP JGzA== X-Gm-Message-State: AMke39nB4GaI0+4YQvblmJysn+Z1sxa3tfioqppLx/QKS4E0JNaAU9H7bqOsz8hECDRmkA== X-Received: by 10.99.168.76 with SMTP id i12mr2896940pgp.73.1486634353567; Thu, 09 Feb 2017 01:59:13 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id a25sm27423984pgd.26.2017.02.09.01.59.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Feb 2017 01:59:12 -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 v2] omapfb: dss: Handle return error in dss_init_ports. Date: Thu, 9 Feb 2017 15:28:01 +0530 Message-Id: <1486634281-10945-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 | 10 +++++++--- 1 file changed, 7 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..87eb10c 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,20 @@ 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; + if (ret) + dss_uninit_ports(pdev); + + return ret; } static void dss_uninit_ports(struct platform_device *pdev)