SPI dynamic busid generation bugfix
authorDavid Brownell <david-b@pacbell.net>
Sun, 3 Jun 2007 20:50:40 +0000 (13:50 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 4 Jun 2007 20:25:09 +0000 (13:25 -0700)
Fix SPI dynamic bus ID assignment to start at 2^15-1 rather than a negative
number.  Valid bus ids are supposed to be positive, and are (now) stored in
an 's16' value.

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

index c3219b29b5ac70b87190c36b195c4a6139dc385b..4831edbae2d589a0442021df9ee78aeaec10430f 100644 (file)
@@ -411,7 +411,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master);
  */
 int spi_register_master(struct spi_master *master)
 {
-       static atomic_t         dyn_bus_id = ATOMIC_INIT((1<<16) - 1);
+       static atomic_t         dyn_bus_id = ATOMIC_INIT((1<<15) - 1);
        struct device           *dev = master->cdev.dev;
        int                     status = -ENODEV;
        int                     dynamic = 0;