diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-22 13:49:16 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-05-22 13:49:16 -0400 |
commit | de81d2aaebc8e5e5167cb93f674c57705898e45e (patch) | |
tree | d452f6b0f41879617a75e1fe9092f196de108bf1 /drivers/i2c/i2c-core.c | |
parent | d25790532370e7448e3d3bd25a17e1e9f1299816 (diff) |
i2c: Legacy i2c drivers shouldn't issue uevents
Prevent legacy drivers from issuing uevents for device creation/removal,
so that userspace can't cause modprobing loops for them. This became a
problem for some legacy PC drivers. I can't easily see it becoming an
issue with I2C legacy drivers, but consistency-in-paranoia seems likely
to be a good thing here. For usable i2c-level driver model uevents, just
switch to a new-style driver.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
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 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 64f8e56d300e..435925eba437 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -697,9 +697,10 @@ int i2c_attach_client(struct i2c_client *client) | |||
697 | if (client->driver) | 697 | if (client->driver) |
698 | client->dev.driver = &client->driver->driver; | 698 | client->dev.driver = &client->driver->driver; |
699 | 699 | ||
700 | if (client->driver && !is_newstyle_driver(client->driver)) | 700 | if (client->driver && !is_newstyle_driver(client->driver)) { |
701 | client->dev.release = i2c_client_release; | 701 | client->dev.release = i2c_client_release; |
702 | else | 702 | client->dev.uevent_suppress = 1; |
703 | } else | ||
703 | client->dev.release = i2c_client_dev_release; | 704 | client->dev.release = i2c_client_dev_release; |
704 | 705 | ||
705 | snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), | 706 | snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), |