]> git.baikalelectronics.ru Git - kernel.git/commit
spi device setup gets better error checking
authorDavid Brownell <david-b@pacbell.net>
Tue, 31 Jul 2007 07:39:45 +0000 (00:39 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 31 Jul 2007 22:39:44 +0000 (15:39 -0700)
commit3fa0e4d48dd199352deed4483126ca69e1b49913
tree5f4ec8042b29272f0fd0c28b2cc2c0bb63f38dc0
parent88287165a040cbf347626a24baab08e9502987ea
spi device setup gets better error checking

This updates some error reporting paths in SPI device setup:

 - Move validation logic for SPI chipselects to spi_new_device(),
   which is where it should always have been.

 - In spi_new_device(), emit error messages if the device can't
   be created.  This is LOTS better than a silent failure; though
   eventually, the calling convention should probably change to
   use the <linux/err.h> conventions.

 - Includes one previously-missing check:  SPI masters must always
   have at least one chipselect, even for dedicated busses which
   always keep it selected!

It also adds a FIXME (IDR for dynamic ID allocation) so the issue doesn't live
purely in my mailbox.

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>
drivers/spi/spi.c