|
@@ -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)
|
|
static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
|
|
|
{
|
|
{
|
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
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",
|
|
if (add_uevent_var(env, "MODALIAS=%s%s",
|
|
|
I2C_MODULE_PREFIX, client->name))
|
|
I2C_MODULE_PREFIX, client->name))
|
|
@@ -409,6 +414,12 @@ static ssize_t
|
|
|
show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
|
|
show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
|
|
|
{
|
|
{
|
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
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);
|
|
return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
|
|
|
}
|
|
}
|
|
|
|
|
|