diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-06-19 16:58:19 +0200 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-06-19 16:58:19 +0200 |
commit | 1e40ac12dab22d98d0178e87364cf4e36862809c (patch) | |
tree | 4a17e391d0b4d33bd9d13c077c789145f436dd76 /drivers | |
parent | f8a227e8ac19c2d3e189833b8518b1805d9b443c (diff) |
i2c: Kill is_newstyle_driver
Legacy i2c drivers are gone, all drivers are new-style now, so there
is no point to check.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/i2c-core.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 06c428b5822..95fb997b41e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -41,8 +41,6 @@ static DEFINE_MUTEX(core_lock); static DEFINE_IDR(i2c_adapter_idr); -#define is_newstyle_driver(d) ((d)->probe || (d)->remove || (d)->detect) - static int i2c_check_addr(struct i2c_adapter *adapter, int addr); static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver); @@ -64,12 +62,6 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv) struct i2c_client *client = to_i2c_client(dev); struct i2c_driver *driver = to_i2c_driver(drv); - /* make legacy i2c drivers bypass driver model probing entirely; - * such drivers scan each i2c adapter/bus themselves. - */ - if (!is_newstyle_driver(driver)) - return 0; - /* match on an id table if there is one */ if (driver->id_table) return i2c_match_id(driver->id_table, client) != NULL; @@ -172,12 +164,6 @@ static int i2c_device_resume(struct device *dev) return driver->resume(to_i2c_client(dev)); } -static void i2c_client_release(struct device *dev) -{ - struct i2c_client *client = to_i2c_client(dev); - complete(&client->released); -} - static void i2c_client_dev_release(struct device *dev) { kfree(to_i2c_client(dev)); @@ -282,12 +268,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) client->dev.parent = &client->adapter->dev; client->dev.bus = &i2c_bus_type; - - if (client->driver && !is_newstyle_driver(client->driver)) { - client->dev.release = i2c_client_release; - dev_set_uevent_suppress(&client->dev, 1); - } else - client->dev.release = i2c_client_dev_release; + client->dev.release = i2c_client_dev_release; dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adap), client->addr); @@ -321,14 +302,6 @@ EXPORT_SYMBOL_GPL(i2c_new_device); void i2c_unregister_device(struct i2c_client *client) { struct i2c_adapter *adapter = client->adapter; - struct i2c_driver *driver = client->driver; - - if (driver && !is_newstyle_driver(driver)) { - dev_err(&client->dev, "can't unregister devices " - "with legacy drivers\n"); - WARN_ON(1); - return; - } mutex_lock(&adapter->clist_lock); list_del(&client->list); @@ -736,9 +709,6 @@ static int __detach_adapter(struct device *dev, void *data) i2c_unregister_device(client); } - if (is_newstyle_driver(driver)) - return 0; - if (driver->detach_adapter) { if (driver->detach_adapter(adapter)) dev_err(&adapter->dev, |