aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/i2c/i2c-core.c22
-rw-r--r--include/linux/i2c.h7
-rw-r--r--include/linux/i2c/pcf857x.h3
3 files changed, 7 insertions, 25 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c99ebeadb558..d0175f4f8fc6 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
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 6716ec808c5e..fb9af6a0fe9c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -155,8 +155,6 @@ struct i2c_driver {
155 * @driver: device's driver, hence pointer to access routines 155 * @driver: device's driver, hence pointer to access routines
156 * @dev: Driver model device node for the slave. 156 * @dev: Driver model device node for the slave.
157 * @irq: indicates the IRQ generated by this device (if any) 157 * @irq: indicates the IRQ generated by this device (if any)
158 * @driver_name: Identifies new-style driver used with this device; also
159 * used as the module name for hotplug/coldplug modprobe support.
160 * @list: list of active/busy clients (DEPRECATED) 158 * @list: list of active/busy clients (DEPRECATED)
161 * @released: used to synchronize client releases & detaches and references 159 * @released: used to synchronize client releases & detaches and references
162 * 160 *
@@ -174,7 +172,6 @@ struct i2c_client {
174 struct i2c_driver *driver; /* and our access routines */ 172 struct i2c_driver *driver; /* and our access routines */
175 struct device dev; /* the device structure */ 173 struct device dev; /* the device structure */
176 int irq; /* irq issued by device (or -1) */ 174 int irq; /* irq issued by device (or -1) */
177 char driver_name[KOBJ_NAME_LEN];
178 struct list_head list; /* DEPRECATED */ 175 struct list_head list; /* DEPRECATED */
179 struct completion released; 176 struct completion released;
180}; 177};
@@ -200,8 +197,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
200 197
201/** 198/**
202 * struct i2c_board_info - template for device creation 199 * struct i2c_board_info - template for device creation
203 * @driver_name: identifies the driver to be bound to the device 200 * @type: chip type, to initialize i2c_client.name
204 * @type: optional chip type information, to initialize i2c_client.name
205 * @flags: to initialize i2c_client.flags 201 * @flags: to initialize i2c_client.flags
206 * @addr: stored in i2c_client.addr 202 * @addr: stored in i2c_client.addr
207 * @platform_data: stored in i2c_client.dev.platform_data 203 * @platform_data: stored in i2c_client.dev.platform_data
@@ -220,7 +216,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
220 * with the adapter already known. 216 * with the adapter already known.
221 */ 217 */
222struct i2c_board_info { 218struct i2c_board_info {
223 char driver_name[KOBJ_NAME_LEN];
224 char type[I2C_NAME_SIZE]; 219 char type[I2C_NAME_SIZE];
225 unsigned short flags; 220 unsigned short flags;
226 unsigned short addr; 221 unsigned short addr;
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
index ba8ea6e16476..0767a2a6b2f1 100644
--- a/include/linux/i2c/pcf857x.h
+++ b/include/linux/i2c/pcf857x.h
@@ -12,8 +12,7 @@
12 * @context: optional parameter passed to setup() and teardown() 12 * @context: optional parameter passed to setup() and teardown()
13 * 13 *
14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
15 * the i2c_board_info used with the pcf875x driver must provide the 15 * the i2c_board_info used with the pcf875x driver must provide its
16 * chip "type" ("pcf8574", "pcf8574a", "pcf8575", "pcf8575c") and its
17 * platform_data (pointer to one of these structures) with at least 16 * platform_data (pointer to one of these structures) with at least
18 * the gpio_base value initialized. 17 * the gpio_base value initialized.
19 * 18 *