diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 22:38:30 +0200 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 22:38:30 +0200 |
commit | e0457442fd522107204da14a2dc2cbbb5dcac5f6 (patch) | |
tree | c489c15479cab107cb435a875e8119d10be5fc04 /drivers/i2c/i2c-core.c | |
parent | 1b4dff9cd37d430bc76112396e92bb3552f37ccd (diff) | |
download | op-kernel-dev-e0457442fd522107204da14a2dc2cbbb5dcac5f6.zip op-kernel-dev-e0457442fd522107204da14a2dc2cbbb5dcac5f6.tar.gz |
i2c: Simplify i2c_device_probe
i2c_driver.id_table is mandatory now, so we can simplify
i2c_device_probe() a bit.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index e06067e..d6cc58a 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -101,19 +101,14 @@ static int i2c_device_probe(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct i2c_driver *driver = to_i2c_driver(dev->driver); - const struct i2c_device_id *id; int status; - if (!driver->probe) + if (!driver->probe || !driver->id_table) return -ENODEV; client->driver = driver; dev_dbg(dev, "probe\n"); - if (driver->id_table) - id = i2c_match_id(driver->id_table, client); - else - id = NULL; - status = driver->probe(client, id); + status = driver->probe(client, i2c_match_id(driver->id_table, client)); if (status) client->driver = NULL; return status; |