Skip to content

Commit

Permalink
[PATCH] spi: remove return in spi_unregister_driver()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and Linus Torvalds committed Feb 12, 2007
1 parent 14fd9b3 commit ddc1e97
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddc1e97

Please sign in to comment.