summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-07-12 00:23:30 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-15 10:08:11 +0200
commit82022ecce6a21d13f9a378c0b233d577220ee1f5 (patch)
treef4e95f450087a3cef10e2b2d28f31e4eef0a07ab /drivers/i2c
parent4802ed1489c9b51170b95d528bf82c40bbddbf1e (diff)
downloadbarebox-82022ecce6a21d13f9a378c0b233d577220ee1f5.tar.gz
barebox-82022ecce6a21d13f9a378c0b233d577220ee1f5.tar.xz
i2c: Reuse "driver_match" for I2C 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/i2c')
-rw-r--r--drivers/i2c/i2c.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 3e095476a9..ccc484480f 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -454,26 +454,6 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
}
EXPORT_SYMBOL(i2c_add_numbered_adapter);
-static int i2c_match(struct device_d *dev, struct driver_d *drv)
-{
- if (!strcmp(dev->name, drv->name))
- return 0;
-
- if (drv->id_table) {
- struct platform_device_id *id = drv->id_table;
-
- while (id->name) {
- if (!strcmp(id->name, dev->name)) {
- dev->id_entry = id;
- return 0;
- }
- id++;
- }
- }
-
- return -1;
-}
-
static int i2c_probe(struct device_d *dev)
{
return dev->driver->probe(dev);
@@ -486,7 +466,7 @@ static void i2c_remove(struct device_d *dev)
struct bus_type i2c_bus = {
.name = "i2c",
- .match = i2c_match,
+ .match = device_match,
.probe = i2c_probe,
.remove = i2c_remove,
};