From patchwork Fri Sep 3 07:19:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 152401 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 o837Jidx012912 for ; Fri, 3 Sep 2010 07:19:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718Ab0ICHTu (ORCPT ); Fri, 3 Sep 2010 03:19:50 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:55912 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1754458Ab0ICHTt (ORCPT ); Fri, 3 Sep 2010 03:19:49 -0400 Received: (qmail invoked by alias); 03 Sep 2010 07:19:47 -0000 Received: from p50898987.dip0.t-ipconnect.de (EHLO axis700.grange) [80.137.137.135] by mail.gmx.net (mp053) with SMTP; 03 Sep 2010 09:19:47 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX19lWRtrzlhlmZ9Y4NKtRYY5wC6v63IOLHIVzsJ4zn 6Gm+7MohTs7Zon Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OrQZ3-0000vG-PM; Fri, 03 Sep 2010 09:19:57 +0200 Date: Fri, 3 Sep 2010 09:19:57 +0200 (CEST) From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org cc: linux-fbdev@vger.kernel.org Subject: [PATCH 03/15] fbdev: sh_mobile_lcdcfb: fix more error paths In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Sep 2010 07:19:51 +0000 (UTC) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 43132de..295bf4b 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -614,7 +614,7 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv) * flush frame, and wait for frame end interrupt * clean up deferred io and enable clock */ - if (ch->info->fbdefio) { + if (ch->info && ch->info->fbdefio) { ch->frame_end = 0; schedule_delayed_work(&ch->info->deferred_work, 0); wait_event(ch->frame_end_wait, ch->frame_end); @@ -704,7 +704,6 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev, return PTR_ERR(priv->dot_clk); } } - atomic_set(&priv->hw_usecnt, -1); /* Runtime PM support involves two step for this driver: * 1) Enable Runtime PM @@ -1055,6 +1054,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) priv->irq = i; pdata = pdev->dev.platform_data; + atomic_set(&priv->hw_usecnt, -1); j = 0; for (i = 0; i < ARRAY_SIZE(pdata->ch); i++) {