diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-07-12 00:23:29 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-15 10:08:11 +0200 |
commit | 4802ed1489c9b51170b95d528bf82c40bbddbf1e (patch) | |
tree | 8741c87456f4c367d013a1e50575c2cd5b561feb /drivers/spi | |
parent | 7bc400d14ccfeae112de106ffe6c3ba57e41b11e (diff) | |
download | barebox-4802ed1489c9b51170b95d528bf82c40bbddbf1e.tar.gz barebox-4802ed1489c9b51170b95d528bf82c40bbddbf1e.tar.xz |
spi: Reuse "driver_match" for SPI bus
This will allow to use device_ids and make code a bit smaller.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5d4dfd6f02..55bebe0de3 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -289,15 +289,6 @@ int spi_write_then_read(struct spi_device *spi, } EXPORT_SYMBOL(spi_write_then_read); -static int spi_match(struct device_d *dev, struct driver_d *drv) -{ - if (IS_ENABLED(CONFIG_OFDEVICE) && dev->device_node && - drv->of_compatible) - return of_match(dev, drv); - - return strcmp(dev->name, drv->name) ? -1 : 0; -} - static int spi_probe(struct device_d *dev) { return dev->driver->probe(dev); @@ -310,7 +301,7 @@ static void spi_remove(struct device_d *dev) struct bus_type spi_bus = { .name = "spi", - .match = spi_match, + .match = device_match, .probe = spi_probe, .remove = spi_remove, }; |