diff mbox

au1200fb: fix hardcoded IRQ

Message ID 1307898929-12365-1-git-send-email-manuel.lauss@googlemail.com (mailing list archive)
State Accepted
Commit 1630d85a831273868651d46d74f069e0cdf9b698
Headers show

Commit Message

Manuel Lauss June 12, 2011, 5:15 p.m. UTC
Use the IRQ provided by platform resource information.
Required for Au1300 support.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
applies on top of the other 3 au1200fb patches sent earlier.

 drivers/video/au1200fb.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

Comments

Paul Mundt June 14, 2011, 7:10 a.m. UTC | #1
On Sun, Jun 12, 2011 at 07:15:29PM +0200, Manuel Lauss wrote:
> Use the IRQ provided by platform resource information.
> Required for Au1300 support.
> 
> Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
> ---
> applies on top of the other 3 au1200fb patches sent earlier.
> 
>  drivers/video/au1200fb.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
> index e018373..e6d3478 100644
> --- a/drivers/video/au1200fb.c
> +++ b/drivers/video/au1200fb.c
> @@ -1631,7 +1631,7 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>  	struct au1200fb_device *fbdev;
>  	struct fb_info *fbi = NULL;
>  	unsigned long page;
> -	int bpp, plane, ret;
> +	int bpp, plane, ret, irq;
>  
>  	/* shut gcc up */
>  	ret = 0;
> @@ -1707,10 +1707,12 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>  	}
>  
>  	/* Now hook interrupt too */
> -	if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
> -		 	  IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) {
> +	irq = platform_get_irq(dev, 0);
> +	ret = request_irq(irq, au1200fb_handle_irq,
> +			  IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
> +	if (ret) {
>  		print_err("fail to request interrupt line %d (err: %d)",
> -			  AU1200_LCD_INT, ret);
> +			  irq, ret);
>  		goto failed;
>  	}
>  
A minor nit, but if you're passing along IRQ information via the platform
data already you could take that a step further and also fetch the IRQ
flags. This would at least allow you to avoid an unconditional
IRQF_SHARED.
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Manuel Lauss June 14, 2011, 8:23 a.m. UTC | #2
Hi Paul,

On Tue, Jun 14, 2011 at 9:10 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Sun, Jun 12, 2011 at 07:15:29PM +0200, Manuel Lauss wrote:
>> Use the IRQ provided by platform resource information.
>> Required for Au1300 support.
>>
>> Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
>> ---
>> applies on top of the other 3 au1200fb patches sent earlier.
>>
>>  drivers/video/au1200fb.c |   12 +++++++-----
>>  1 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
>> index e018373..e6d3478 100644
>> --- a/drivers/video/au1200fb.c
>> +++ b/drivers/video/au1200fb.c
>> @@ -1631,7 +1631,7 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>>       struct au1200fb_device *fbdev;
>>       struct fb_info *fbi = NULL;
>>       unsigned long page;
>> -     int bpp, plane, ret;
>> +     int bpp, plane, ret, irq;
>>
>>       /* shut gcc up */
>>       ret = 0;
>> @@ -1707,10 +1707,12 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>>       }
>>
>>       /* Now hook interrupt too */
>> -     if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
>> -                       IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) {
>> +     irq = platform_get_irq(dev, 0);
>> +     ret = request_irq(irq, au1200fb_handle_irq,
>> +                       IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
>> +     if (ret) {
>>               print_err("fail to request interrupt line %d (err: %d)",
>> -                       AU1200_LCD_INT, ret);
>> +                       irq, ret);
>>               goto failed;
>>       }
>>
> A minor nit, but if you're passing along IRQ information via the platform
> data already you could take that a step further and also fetch the IRQ
> flags. This would at least allow you to avoid an unconditional
> IRQF_SHARED.

That IRQF_SHARED is required because the out-of-tree mpeg decoder
driver attaches to this irq as well.  I'll incorporate it in the rewrite though.

Thanks!
        Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index e018373..e6d3478 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1631,7 +1631,7 @@  static int __devinit au1200fb_drv_probe(struct platform_device *dev)
 	struct au1200fb_device *fbdev;
 	struct fb_info *fbi = NULL;
 	unsigned long page;
-	int bpp, plane, ret;
+	int bpp, plane, ret, irq;
 
 	/* shut gcc up */
 	ret = 0;
@@ -1707,10 +1707,12 @@  static int __devinit au1200fb_drv_probe(struct platform_device *dev)
 	}
 
 	/* Now hook interrupt too */
-	if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
-		 	  IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) {
+	irq = platform_get_irq(dev, 0);
+	ret = request_irq(irq, au1200fb_handle_irq,
+			  IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
+	if (ret) {
 		print_err("fail to request interrupt line %d (err: %d)",
-			  AU1200_LCD_INT, ret);
+			  irq, ret);
 		goto failed;
 	}
 
@@ -1758,7 +1760,7 @@  static int __devexit au1200fb_drv_remove(struct platform_device *dev)
 		_au1200fb_infos[plane] = NULL;
 	}
 
-	free_irq(AU1200_LCD_INT, (void *)dev);
+	free_irq(platform_get_irq(dev, 0), (void *)dev);
 
 	return 0;
 }