]> Pileus Git - ~andy/linux/blobdiff - drivers/i2c/i2c-core.c
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[~andy/linux] / drivers / i2c / i2c-core.c
index dd3a4dbb4718f98cbead83915ee00e29e9704a5f..5fb80b8962a2ad7d8e78dcee01df68cb639d3602 100644 (file)
@@ -21,7 +21,7 @@
 /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi>.
    All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>
    SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> and
-   Jean Delvare <khali@linux-fr.org>
+   Jean Delvare <jdelvare@suse.de>
    Mux support by Rodolfo Giometti <giometti@enneenne.com> and
    Michael Lawnick <michael.lawnick.ext@nsn.com>
    OF support is copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
@@ -104,6 +104,11 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
 static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        struct i2c_client       *client = to_i2c_client(dev);
+       int rc;
+
+       rc = acpi_device_uevent_modalias(dev, env);
+       if (rc != -ENODEV)
+               return rc;
 
        if (add_uevent_var(env, "MODALIAS=%s%s",
                           I2C_MODULE_PREFIX, client->name))
@@ -404,6 +409,12 @@ static ssize_t
 show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct i2c_client *client = to_i2c_client(dev);
+       int len;
+
+       len = acpi_device_modalias(dev, buf, PAGE_SIZE -1);
+       if (len != -ENODEV)
+               return len;
+
        return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
 }