9
0
Fork 0

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>
This commit is contained in:
Alexander Shiyan 2013-07-12 00:23:30 +04:00 committed by Sascha Hauer
parent 4802ed1489
commit 82022ecce6
1 changed files with 1 additions and 21 deletions

View File

@ -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,
};