[PATCH] ARM: request_irq() failure ignored in omap_uart_enable_irqs()

Aguirre Rodriguez, Sergio Alberto saaguirre at ti.com
Wed Sep 2 08:21:47 EDT 2009


(Resending to new ML)

From: Roel Kluin [mailto:roel.kluin at gmail.com]
Sent: Tuesday, September 01, 2009 12:18 PM
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index a7421a5..ed683d9 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -471,11 +471,18 @@ void omap_uart_enable_irqs(int enable)

Wouldn't it make more sense to return int, instead of void here?

The caller would never know if the call internally failed.

Just a thought...

Regards,
Sergio

>  	int ret;
>  	struct omap_uart_state *uart;
> 
> -	list_for_each_entry(uart, &uart_list, node) {
> -		if (enable)
> +	if (enable) {
> +		list_for_each_entry(uart, &uart_list, node) {
>  			ret = request_irq(uart->p->irq, omap_uart_interrupt,
>  				IRQF_SHARED, "serial idle", (void *)uart);
> -		else
> +			if (ret < 0) {
> +				printk(KERN_ERR "omap_uart_enable_irqs: failed to
> request IRQ%i (%i)\n",
> +						uart->p->irq, ret);
> +				return;
> +			}
> +		}
> +	} else {
> +		list_for_each_entry(uart, &uart_list, node)
>  			free_irq(uart->p->irq, (void *)uart);
>  	}
>  }
> 
> 
> -------------------------------------------------------------------
> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-
> kernel
> FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php




More information about the linux-arm-kernel mailing list