Re: [PATCH] spi: check platform_device_register_simple() error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Nov 2006 14:09:15 +0900
Akinobu Mita <[email protected]> wrote:

> This patch checks the return value of platform_device_register_simple().
> 
> Cc: David Brownell <[email protected]>
> Signed-off-by: Akinobu Mita <[email protected]>
> 
> ---
>  drivers/spi/spi_butterfly.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: work-fault-inject/drivers/spi/spi_butterfly.c
> ===================================================================
> --- work-fault-inject.orig/drivers/spi/spi_butterfly.c
> +++ work-fault-inject/drivers/spi/spi_butterfly.c
> @@ -250,6 +250,8 @@ static void butterfly_attach(struct parp
>  	 * setting up a platform device like this is an ugly kluge...
>  	 */
>  	pdev = platform_device_register_simple("butterfly", -1, NULL, 0);
> +	if (IS_ERR(pdev))
> +		return;

It'd be nice to at least print some (non-debug) message rather than simply
mysteriously failing.

It'd be nicer if parport_driver.attach() didn't return void.  Ho hum.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux