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)
commit082c8cb4e5e68c0fd29cc10c59db94d2284fd2b0
tree5f4ec8042b29272f0fd0c28b2cc2c0bb63f38dc0
parent2604288f45605d1b2844f001dc3141149667b3d1
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