[PATCH] spi: remove return in spi_unregister_driver()
authorBen Dooks <ben@fluff.org>
Mon, 12 Feb 2007 08:52:43 +0000 (00:52 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:31 +0000 (09:48 -0800)
Make the spi_unregister_driver() code fit in with the rest of the header
file, and only do the action if the driver passed is non-NULL.

This also makes the code a line smaller.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/spi/spi.h

index e25fcae89d3bf63d15c5e5c2cc9c19c816980dac..851b25d6e82bb9c849a07600a82a75c5a773788f 100644 (file)
@@ -148,13 +148,11 @@ extern int spi_register_driver(struct spi_driver *sdrv);
 
 static inline void spi_unregister_driver(struct spi_driver *sdrv)
 {
-       if (!sdrv)
-               return;
-       driver_unregister(&sdrv->driver);
+       if (sdrv)
+               driver_unregister(&sdrv->driver);
 }
 
 
-
 /**
  * struct spi_master - interface to SPI master controller
  * @cdev: class interface to this driver