* [PATCH] i2c: Simplify i2c_device_probe
@ 2008-06-03 18:29 Jean Delvare
[not found] ` <20080603202954.64d5971c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2008-06-03 18:29 UTC (permalink / raw)
To: Linux I2C; +Cc: Ben Dooks
i2c_driver.id_table is mandatory now, so we can simplify
i2c_device_probe() a bit.
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---
drivers/i2c/i2c-core.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- linux-2.6.26-rc4.orig/drivers/i2c/i2c-core.c 2008-06-03 10:57:55.000000000 +0200
+++ linux-2.6.26-rc4/drivers/i2c/i2c-core.c 2008-06-03 16:38:37.000000000 +0200
@@ -101,19 +101,14 @@ static int i2c_device_probe(struct devic
{
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;
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-03 23:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03 18:29 [PATCH] i2c: Simplify i2c_device_probe Jean Delvare
[not found] ` <20080603202954.64d5971c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-03 23:43 ` Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox