[PATCH] ARM: at91: fix drivers broken because of sparse irq support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Aug 13 22:28:30 EDT 2012


On 17:38 Mon 13 Aug     , ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches at atmel.com>
> 
> Some drivers directly use AT91_ID_SYS as virq so they are broken because of
> the NR_IRQS_LEGACY virq offset introduced with sparse irq support.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches at atmel.com>
> Cc: stable at vger.kernel.org
> ---
>  arch/arm/mach-at91/at91rm9200_time.c |  2 +-
>  drivers/rtc/rtc-at91sam9.c           | 11 ++++++-----
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index 104ca40..aaa443b 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -197,7 +197,7 @@ void __init at91rm9200_timer_init(void)
>  	at91_st_read(AT91_ST_SR);
>  
>  	/* Make IRQs happen for the system timer */
> -	setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
> +	setup_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);
>  
>  	/* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
>  	 * directly for the clocksource and all clockevents, after adjusting
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 8318689..2969047 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -345,11 +345,12 @@ static int __devinit at91_rtc_probe(struct platform_device *pdev)
>  	}
>  
>  	/* register irq handler after we know what name we'll use */
> -	ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
> +	ret = request_irq(NR_IRQS_LEGACY + AT91_ID_SYS, at91_rtc_interrupt,
the irq need to be pass by resources and not hardcoded

Best Regrds,
J.



More information about the linux-arm-kernel mailing list