]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/i2c-core.c
Driver core: change add_uevent_var to use a struct
[linux-2.6-omap-h63xx.git] / drivers / i2c / i2c-core.c
index d663e6960d934e70c294babea743eb7ae7459d51..910a62de190d4e00e5320fcfaa5a8b1c2d26c9a6 100644 (file)
@@ -67,20 +67,16 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
 #ifdef CONFIG_HOTPLUG
 
 /* uevent helps with hotplug: modprobe -q $(MODALIAS) */
-static int i2c_device_uevent(struct device *dev, char **envp, int num_envp,
-                     char *buffer, int buffer_size)
+static int i2c_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        struct i2c_client       *client = to_i2c_client(dev);
-       int                     i = 0, length = 0;
 
        /* by definition, legacy drivers can't hotplug */
        if (dev->driver || !client->driver_name)
                return 0;
 
-       if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                       "MODALIAS=%s", client->driver_name))
+       if (add_uevent_var(env, "MODALIAS=%s", client->driver_name))
                return -ENOMEM;
-       envp[i] = NULL;
        dev_dbg(dev, "uevent\n");
        return 0;
 }