From patchwork Fri Apr 30 16:07:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 95911 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3UHCAC6008589 for ; Fri, 30 Apr 2010 17:12:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758519Ab0D3RHd (ORCPT ); Fri, 30 Apr 2010 13:07:33 -0400 Received: from mail.gmx.net ([213.165.64.20]:45930 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758497Ab0D3RHF (ORCPT ); Fri, 30 Apr 2010 13:07:05 -0400 Received: (qmail invoked by alias); 30 Apr 2010 16:07:01 -0000 Received: from p57BD1CE9.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.28.233] by mail.gmx.net (mp039) with SMTP; 30 Apr 2010 18:07:01 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX18Hv4B+CG4Hr4olPl4gZAhdz72cXVniSY+At9dSzG pwD9J6pSon5oOf Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1O7skE-0001dQ-8g; Fri, 30 Apr 2010 18:07:14 +0200 Date: Fri, 30 Apr 2010 18:07:14 +0200 (CEST) From: Guennadi Liakhovetski To: linux-fbdev@vger.kernel.org cc: "linux-sh@vger.kernel.org" Subject: [PATCH 2/2] sh: make interrupt resource optional in SH framebuffer driver In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.44 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 (demeter.kernel.org [140.211.167.41]); Fri, 30 Apr 2010 17:12:11 +0000 (UTC) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index e498fb5..b8f7811 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -791,6 +791,9 @@ static int sh_mobile_wait_for_vsync(struct fb_info *info) unsigned long ldintr; int ret; + if (!ch->lcdc->irq) + return -ENOIOCTLCMD; + /* Enable VSync End interrupt */ ldintr = lcdc_read(ch->lcdc, _LDINTR); ldintr |= LDINTR_VEE; @@ -962,7 +965,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); i = platform_get_irq(pdev, 0); - if (!res || i < 0) { + if (!res) { dev_err(&pdev->dev, "cannot get platform resources\n"); return -ENOENT; } @@ -975,14 +978,16 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, - dev_name(&pdev->dev), priv); - if (error) { - dev_err(&pdev->dev, "unable to request irq\n"); - goto err1; + if (i >= 0) { + error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, + dev_name(&pdev->dev), priv); + if (error) { + dev_err(&pdev->dev, "unable to request irq\n"); + goto err1; + } + priv->irq = i; } - priv->irq = i; pdata = pdev->dev.platform_data; j = 0;