diff options
author | Feng Tang <feng.tang@intel.com> | 2010-08-02 03:52:15 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-10-22 01:52:16 -0400 |
commit | 2b9603a0d7e395fb844af90fba71448bc8019077 (patch) | |
tree | b828ff7c6819766e92dd304eb5e63e12527e516a /include/linux/spi/spi.h | |
parent | d4429f608abde89e8bc1e24b43cd503feb95c496 (diff) |
spi: enable spi_board_info to be registered after spi_master
Currently spi_register_board_info() has to be called before its related
spi_master be registered, otherwise these board info will be just ignored.
This patch will remove this order limit, it adds a global spi master list
like the existing global board info listr. Whenever a board info or a
spi_master is registered, the spi master list or board info list
will be scanned, and a new spi device will be created if there is a
master-board info match.
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/spi/spi.h')
-rw-r--r-- | include/linux/spi/spi.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 92e52a1e6af3..b4d7710bc38d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
204 | /** | 204 | /** |
205 | * struct spi_master - interface to SPI master controller | 205 | * struct spi_master - interface to SPI master controller |
206 | * @dev: device interface to this driver | 206 | * @dev: device interface to this driver |
207 | * @list: link with the global spi_master list | ||
207 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 208 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
208 | * given SPI controller. | 209 | * given SPI controller. |
209 | * @num_chipselect: chipselects are used to distinguish individual | 210 | * @num_chipselect: chipselects are used to distinguish individual |
@@ -238,6 +239,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
238 | struct spi_master { | 239 | struct spi_master { |
239 | struct device dev; | 240 | struct device dev; |
240 | 241 | ||
242 | struct list_head list; | ||
243 | |||
241 | /* other than negative (== assign one dynamically), bus_num is fully | 244 | /* other than negative (== assign one dynamically), bus_num is fully |
242 | * board-specific. usually that simplifies to being SOC-specific. | 245 | * board-specific. usually that simplifies to being SOC-specific. |
243 | * example: one SOC has three SPI controllers, numbered 0..2, | 246 | * example: one SOC has three SPI controllers, numbered 0..2, |