aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index d74c0b34248e..c4c5588ec0fb 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -104,6 +104,11 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
104static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env) 104static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
105{ 105{
106 struct i2c_client *client = to_i2c_client(dev); 106 struct i2c_client *client = to_i2c_client(dev);
107 int rc;
108
109 rc = acpi_device_uevent_modalias(dev, env);
110 if (rc != -ENODEV)
111 return rc;
107 112
108 if (add_uevent_var(env, "MODALIAS=%s%s", 113 if (add_uevent_var(env, "MODALIAS=%s%s",
109 I2C_MODULE_PREFIX, client->name)) 114 I2C_MODULE_PREFIX, client->name))
@@ -409,6 +414,12 @@ static ssize_t
409show_modalias(struct device *dev, struct device_attribute *attr, char *buf) 414show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
410{ 415{
411 struct i2c_client *client = to_i2c_client(dev); 416 struct i2c_client *client = to_i2c_client(dev);
417 int len;
418
419 len = acpi_device_modalias(dev, buf, PAGE_SIZE -1);
420 if (len != -ENODEV)
421 return len;
422
412 return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name); 423 return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
413} 424}
414 425