aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-05-18 14:49:41 -0400
committerJean Delvare <khali@hyperion.delvare>2008-05-18 14:49:41 -0400
commiteb8a79080984eb9819406a55e4dd17043c380a09 (patch)
tree56a80e440c3220c2cbb5e6485f0f2036165d3870 /drivers
parentaf294867a52bf718df835a688e8c786d550bee26 (diff)
i2c: Kill the old driver matching scheme
Remove the old driver_name/type scheme for i2c driver matching. Only the standard aliasing model will be used from now on. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/i2c-core.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c99ebeadb55..d0175f4f8fc 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -74,10 +74,7 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
74 if (driver->id_table) 74 if (driver->id_table)
75 return i2c_match_id(driver->id_table, client) != NULL; 75 return i2c_match_id(driver->id_table, client) != NULL;
76 76
77 /* new style drivers use the same kind of driver matching policy 77 return 0;
78 * as platform devices or SPI: compare device and driver IDs.
79 */
80 return strcmp(client->driver_name, drv->name) == 0;
81} 78}
82 79
83#ifdef CONFIG_HOTPLUG 80#ifdef CONFIG_HOTPLUG
@@ -91,14 +88,9 @@ static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
91 if (dev->driver) 88 if (dev->driver)
92 return 0; 89 return 0;
93 90
94 if (client->driver_name[0]) { 91 if (add_uevent_var(env, "MODALIAS=%s%s",
95 if (add_uevent_var(env, "MODALIAS=%s", client->driver_name)) 92 I2C_MODULE_PREFIX, client->name))
96 return -ENOMEM; 93 return -ENOMEM;
97 } else {
98 if (add_uevent_var(env, "MODALIAS=%s%s",
99 I2C_MODULE_PREFIX, client->name))
100 return -ENOMEM;
101 }
102 dev_dbg(dev, "uevent\n"); 94 dev_dbg(dev, "uevent\n");
103 return 0; 95 return 0;
104} 96}
@@ -206,9 +198,7 @@ static ssize_t show_client_name(struct device *dev, struct device_attribute *att
206static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf) 198static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
207{ 199{
208 struct i2c_client *client = to_i2c_client(dev); 200 struct i2c_client *client = to_i2c_client(dev);
209 return client->driver_name[0] 201 return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
210 ? sprintf(buf, "%s\n", client->driver_name)
211 : sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
212} 202}
213 203
214static struct device_attribute i2c_dev_attrs[] = { 204static struct device_attribute i2c_dev_attrs[] = {
@@ -282,8 +272,6 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
282 client->addr = info->addr; 272 client->addr = info->addr;
283 client->irq = info->irq; 273 client->irq = info->irq;
284 274
285 strlcpy(client->driver_name, info->driver_name,
286 sizeof(client->driver_name));
287 strlcpy(client->name, info->type, sizeof(client->name)); 275 strlcpy(client->name, info->type, sizeof(client->name));
288 276
289 /* a new style driver may be bound to this device when we 277 /* a new style driver may be bound to this device when we