diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-14 10:06:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-14 11:47:24 +0200 |
commit | 617bfbcbeb3a278c76ab53e76b4fb7a086255a1e (patch) | |
tree | 6d586f6ec3b3b99d4059a776222516c30848908b /include/spi | |
parent | 4def29f141c99d3d77bb7f5813cbd630d571e970 (diff) | |
download | barebox-617bfbcbeb3a278c76ab53e76b4fb7a086255a1e.tar.gz barebox-617bfbcbeb3a278c76ab53e76b4fb7a086255a1e.tar.xz |
SPI: Put SPI devices on their own bus
This patch adds a SPI bus on which the SPI devices and drivers register.
This makes it cleaner as SPI devices won't accidently end up probed by
a platform_device driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'include/spi')
-rw-r--r-- | include/spi/spi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/spi/spi.h b/include/spi/spi.h index 9d01d068da..569cdcdd99 100644 --- a/include/spi/spi.h +++ b/include/spi/spi.h @@ -427,4 +427,11 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd) #endif /* DOXYGEN_SHOULD_SKIP_THIS */ +extern struct bus_type spi_bus; + +static inline int spi_register_driver(struct driver_d *drv) +{ + drv->bus = &spi_bus; + return register_driver(drv); +} #endif /* __INCLUDE_SPI_H */ |