aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-06-19 10:58:19 -0400
committerJean Delvare <khali@linux-fr.org>2009-06-19 10:58:19 -0400
commit1e40ac12dab22d98d0178e87364cf4e36862809c (patch)
tree4a17e391d0b4d33bd9d13c077c789145f436dd76 /drivers/i2c
parentf8a227e8ac19c2d3e189833b8518b1805d9b443c (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/i2c')
-rw-r--r--drivers/i2c/i2c-core.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 06c428b5822e..95fb997b41e0 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -41,8 +41,6 @@
41static DEFINE_MUTEX(core_lock); 41static DEFINE_MUTEX(core_lock);
42static DEFINE_IDR(i2c_adapter_idr); 42static DEFINE_IDR(i2c_adapter_idr);
43 43
44#define is_newstyle_driver(d) ((d)->probe || (d)->remove || (d)->detect)
45
46static int i2c_check_addr(struct i2c_adapter *adapter, int addr); 44static int i2c_check_addr(struct i2c_adapter *adapter, int addr);
47static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver); 45static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver);
48 46
@@ -64,12 +62,6 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
64 struct i2c_client *client = to_i2c_client(dev); 62 struct i2c_client *client = to_i2c_client(dev);
65 struct i2c_driver *driver = to_i2c_driver(drv); 63 struct i2c_driver *driver = to_i2c_driver(drv);
66 64
67 /* make legacy i2c drivers bypass driver model probing entirely;
68 * such drivers scan each i2c adapter/bus themselves.
69 */
70 if (!is_newstyle_driver(driver))
71 return 0;
72
73 /* match on an id table if there is one */ 65 /* match on an id table if there is one */
74 if (driver->id_table) 66 if (driver->id_table)
75 return i2c_match_id(driver->id_table, client) != NULL; 67 return i2c_match_id(driver->id_table, client) != NULL;
@@ -172,12 +164,6 @@ static int i2c_device_resume(struct device *dev)
172 return driver->resume(to_i2c_client(dev)); 164 return driver->resume(to_i2c_client(dev));
173} 165}
174 166
175static void i2c_client_release(struct device *dev)
176{
177 struct i2c_client *client = to_i2c_client(dev);
178 complete(&client->released);
179}
180
181static void i2c_client_dev_release(struct device *dev) 167static void i2c_client_dev_release(struct device *dev)
182{ 168{
183 kfree(to_i2c_client(dev)); 169 kfree(to_i2c_client(dev));
@@ -282,12 +268,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
282 268
283 client->dev.parent = &client->adapter->dev; 269 client->dev.parent = &client->adapter->dev;
284 client->dev.bus = &i2c_bus_type; 270 client->dev.bus = &i2c_bus_type;
285 271 client->dev.release = i2c_client_dev_release;
286 if (client->driver && !is_newstyle_driver(client->driver)) {
287 client->dev.release = i2c_client_release;
288 dev_set_uevent_suppress(&client->dev, 1);
289 } else
290 client->dev.release = i2c_client_dev_release;
291 272
292 dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adap), 273 dev_set_name(&client->dev, "%d-%04x", i2c_adapter_id(adap),
293 client->addr); 274 client->addr);
@@ -321,14 +302,6 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
321void i2c_unregister_device(struct i2c_client *client) 302void i2c_unregister_device(struct i2c_client *client)
322{ 303{
323 struct i2c_adapter *adapter = client->adapter; 304 struct i2c_adapter *adapter = client->adapter;
324 struct i2c_driver *driver = client->driver;
325
326 if (driver && !is_newstyle_driver(driver)) {
327 dev_err(&client->dev, "can't unregister devices "
328 "with legacy drivers\n");
329 WARN_ON(1);
330 return;
331 }
332 305
333 mutex_lock(&adapter->clist_lock); 306 mutex_lock(&adapter->clist_lock);
334 list_del(&client->list); 307 list_del(&client->list);
@@ -736,9 +709,6 @@ static int __detach_adapter(struct device *dev, void *data)
736 i2c_unregister_device(client); 709 i2c_unregister_device(client);
737 } 710 }
738 711
739 if (is_newstyle_driver(driver))
740 return 0;
741
742 if (driver->detach_adapter) { 712 if (driver->detach_adapter) {
743 if (driver->detach_adapter(adapter)) 713 if (driver->detach_adapter(adapter))
744 dev_err(&adapter->dev, 714 dev_err(&adapter->dev,