From patchwork Thu May 5 16:35:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 757702 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p45GXhdE017659 for ; Thu, 5 May 2011 16:35:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755385Ab1EEQfO (ORCPT ); Thu, 5 May 2011 12:35:14 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:57771 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755361Ab1EEQfN (ORCPT ); Thu, 5 May 2011 12:35:13 -0400 Received: from axis700.grange (pD9EB90E6.dip0.t-ipconnect.de [217.235.144.230]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MflE8-1Q5qIG0jhs-00NZBr; Thu, 05 May 2011 18:35:12 +0200 Received: by axis700.grange (Postfix, from userid 1000) id DA4DF189B89; Thu, 5 May 2011 18:35:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id D126D189B88; Thu, 5 May 2011 18:35:11 +0200 (CEST) Date: Thu, 5 May 2011 18:35:11 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-fbdev@vger.kernel.org, Magnus Damm Subject: [PATCH] fbdev: sh_mobile_hdmi: runtime suspend HDMI on error and clean up paths Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:DMAwd8atpwtY5rhZ2alNBJnxvafb4dtOOE4KmJzWh1k CR10feF80nvBxEM2G+vLUQbEj/8n+21zx0TX6vyYY8lvAYRS4q 6IEjRHjA5aqDkLnd0Dch5VnQk5G8os7ctmN/W3IXcZkHW++7tg 0K34Mc9Zxxy5k7vnS/SfanbiqJVTpTeHcYWtZYZMsyR8doErP/ hbGiJjHhz87i/QPn/HXM+E6foDiGadG4sXhJdYDw70= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 05 May 2011 16:35:14 +0000 (UTC) Signed-off-by: Guennadi Liakhovetski --- drivers/video/sh_mobile_hdmi.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 2b9e56a..6ae40b6 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -1131,15 +1131,19 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) pm_runtime_get_sync(hdmi->dev); ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate); - if (ret < 0) + if (ret < 0) { + pm_runtime_put(hdmi->dev); goto out; + } hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE; /* Reconfigure the clock */ ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate); - if (ret < 0) + if (ret < 0) { + pm_runtime_put(hdmi->dev); goto out; + } msleep(10); sh_hdmi_configure(hdmi); @@ -1336,6 +1340,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) ecodec: free_irq(irq, hdmi); ereqirq: + pm_runtime_suspend(&pdev->dev); pm_runtime_disable(&pdev->dev); iounmap(hdmi->base); emap: @@ -1372,6 +1377,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) free_irq(irq, hdmi); /* Wait for already scheduled work */ cancel_delayed_work_sync(&hdmi->edid_work); + pm_runtime_suspend(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable(hdmi->hdmi_clk); clk_put(hdmi->hdmi_clk);