aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-04-03 18:49:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-05-16 17:33:57 -0400
commita020ed7521a9737bcf3e34eb880867c60c3c68d0 (patch)
tree52941e00b05df6c1bfe228fd193fdb09cf963d15 /include/linux
parentccf77cc4af5b048e20cfd9327fcc286cb69c34cc (diff)
[PATCH] SPI: busnum == 0 needs to work
We need to be able to have a "SPI bus 0" matching chip numbering; but that number was wrongly used to flag dynamic allocation of a bus number. This patch resolves that issue; now negative numbers trigger dynamic alloc. It also updates the how-to-write-a-controller-driver overview to mention this stuff. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/spi/spi.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 77add901691d..e928c0dcc297 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -172,13 +172,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
172struct spi_master { 172struct spi_master {
173 struct class_device cdev; 173 struct class_device cdev;
174 174
175 /* other than zero (== assign one dynamically), bus_num is fully 175 /* other than negative (== assign one dynamically), bus_num is fully
176 * board-specific. usually that simplifies to being SOC-specific. 176 * board-specific. usually that simplifies to being SOC-specific.
177 * example: one SOC has three SPI controllers, numbered 1..3, 177 * example: one SOC has three SPI controllers, numbered 0..2,
178 * and one board's schematics might show it using SPI-2. software 178 * and one board's schematics might show it using SPI-2. software
179 * would normally use bus_num=2 for that controller. 179 * would normally use bus_num=2 for that controller.
180 */ 180 */
181 u16 bus_num; 181 s16 bus_num;
182 182
183 /* chipselects will be integral to many controllers; some others 183 /* chipselects will be integral to many controllers; some others
184 * might use board-specific GPIOs. 184 * might use board-specific GPIOs.