From patchwork Sat Nov 3 00:31:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 1691111 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A1F153FCDE for ; Fri, 2 Nov 2012 23:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756210Ab2KBXeT (ORCPT ); Fri, 2 Nov 2012 19:34:19 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:48286 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753141Ab2KBXeN (ORCPT ); Fri, 2 Nov 2012 19:34:13 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA2NYDWI029592 for ; Fri, 2 Nov 2012 18:34:13 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2NYDBb013386 for ; Fri, 2 Nov 2012 18:34:13 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 2 Nov 2012 18:34:12 -0500 Received: from localhost (dexx0075479.dextra-mty.naucm.ext.ti.com [10.87.228.135]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA2NYCuK002744; Fri, 2 Nov 2012 18:34:12 -0500 From: Ricardo Neri To: CC: , , , , Ricardo Neri Subject: [PATCH v2 4/7] OMAPDSS: HDMI: Handle panel init error at probe Date: Fri, 2 Nov 2012 18:31:45 -0600 Message-ID: <1351902708-866-5-git-send-email-ricardo.neri@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1351902708-866-1-git-send-email-ricardo.neri@ti.com> References: <1351902708-866-1-git-send-email-ricardo.neri@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Do not blindly assume that the panel could be initialized. While there, group mutex initialization at a single place. Signed-off-by: Ricardo Neri --- drivers/video/omap2/dss/hdmi.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 51ee0a6..696386c 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -60,6 +60,7 @@ static struct { struct mutex lock; struct platform_device *pdev; + struct hdmi_ip_data ip_data; struct clk *sys_clk; @@ -1004,6 +1005,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) hdmi.pdev = pdev; mutex_init(&hdmi.lock); + mutex_init(&hdmi.ip_data.lock); res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); if (!res) { @@ -1031,9 +1033,11 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) hdmi.ip_data.pll_offset = HDMI_PLLCTRL; hdmi.ip_data.phy_offset = HDMI_PHY; - mutex_init(&hdmi.ip_data.lock); - - hdmi_panel_init(); + r = hdmi_panel_init(); + if (r) { + DSSERR("can't init panel\n"); + goto err_panel_init; + } dss_debugfs_create_file("hdmi", hdmi_dump_regs); @@ -1042,6 +1046,10 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) hdmi_probe_pdata(pdev); return 0; + +err_panel_init: + hdmi_put_clocks(); + return r; } static int __exit hdmi_remove_child(struct device *dev, void *data)