提交 238a871e 编写于 作者: J Jean Delvare 提交者: Jean Delvare

i2c: Switch pasemi to the new device/driver matching scheme

The old device/driver matching scheme is going away so stop using it.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Acked-by: NOlof Johansson <olof@lixom.net>
上级 24fbacca
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
*/ */
struct i2c_driver_device { struct i2c_driver_device {
char *of_device; char *of_device;
char *i2c_driver;
char *i2c_type; char *i2c_type;
}; };
static struct i2c_driver_device i2c_devices[] __initdata = { static struct i2c_driver_device i2c_devices[] __initdata = {
{"dallas,ds1338", "rtc-ds1307", "ds1338"}, {"dallas,ds1338", "ds1338"},
}; };
static int __init find_i2c_driver(struct device_node *node, static int __init find_i2c_driver(struct device_node *node,
...@@ -40,9 +39,7 @@ static int __init find_i2c_driver(struct device_node *node, ...@@ -40,9 +39,7 @@ static int __init find_i2c_driver(struct device_node *node,
for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
if (!of_device_is_compatible(node, i2c_devices[i].of_device)) if (!of_device_is_compatible(node, i2c_devices[i].of_device))
continue; continue;
if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver, if (strlcpy(info->type, i2c_devices[i].i2c_type,
KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
strlcpy(info->type, i2c_devices[i].i2c_type,
I2C_NAME_SIZE) >= I2C_NAME_SIZE) I2C_NAME_SIZE) >= I2C_NAME_SIZE)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册