diff options
author | Jan Luebbe <jlu@pengutronix.de> | 2012-05-14 12:43:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-14 19:47:13 +0200 |
commit | 7b5817e58d77d44d1e85fb25e384785d2682ed7d (patch) | |
tree | 3acbbba730f4837e44fea753947c63da90edc3ca | |
parent | 932f54688f83ab4a7532614042398dd46722dcd2 (diff) | |
download | barebox-7b5817e58d77d44d1e85fb25e384785d2682ed7d.tar.gz barebox-7b5817e58d77d44d1e85fb25e384785d2682ed7d.tar.xz |
drivers/spi/spi.c: use DEVICE_ID_DYNAMIC when allocating a struct device_d
This causes allocation of a free id and avoids conflicts if multiple
identical SPI devices are attached.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/spi/spi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 7a8aed42e2..a7fe10cba0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -78,6 +78,8 @@ struct spi_device *spi_new_device(struct spi_master *master, proxy->bits_per_word = chip->bits_per_word ? chip->bits_per_word : 8; proxy->dev.platform_data = chip->platform_data; strcpy(proxy->dev.name, chip->name); + /* allocate a free id for this chip */ + proxy->dev.id = DEVICE_ID_DYNAMIC; proxy->dev.type_data = proxy; dev_add_child(master->dev, &proxy->dev); |