diff options
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r-- | drivers/w1/w1.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index a593f900eff4..070217322c9f 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -197,7 +197,7 @@ static struct w1_family w1_default_family = { | |||
197 | .fops = &w1_default_fops, | 197 | .fops = &w1_default_fops, |
198 | }; | 198 | }; |
199 | 199 | ||
200 | static int w1_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); | 200 | static int w1_uevent(struct device *dev, struct kobj_uevent_env *env); |
201 | 201 | ||
202 | static struct bus_type w1_bus_type = { | 202 | static struct bus_type w1_bus_type = { |
203 | .name = "w1", | 203 | .name = "w1", |
@@ -396,13 +396,12 @@ static void w1_destroy_master_attributes(struct w1_master *master) | |||
396 | } | 396 | } |
397 | 397 | ||
398 | #ifdef CONFIG_HOTPLUG | 398 | #ifdef CONFIG_HOTPLUG |
399 | static int w1_uevent(struct device *dev, char **envp, int num_envp, | 399 | static int w1_uevent(struct device *dev, struct kobj_uevent_env *env) |
400 | char *buffer, int buffer_size) | ||
401 | { | 400 | { |
402 | struct w1_master *md = NULL; | 401 | struct w1_master *md = NULL; |
403 | struct w1_slave *sl = NULL; | 402 | struct w1_slave *sl = NULL; |
404 | char *event_owner, *name; | 403 | char *event_owner, *name; |
405 | int err, cur_index=0, cur_len=0; | 404 | int err; |
406 | 405 | ||
407 | if (dev->driver == &w1_master_driver) { | 406 | if (dev->driver == &w1_master_driver) { |
408 | md = container_of(dev, struct w1_master, dev); | 407 | md = container_of(dev, struct w1_master, dev); |
@@ -423,23 +422,19 @@ static int w1_uevent(struct device *dev, char **envp, int num_envp, | |||
423 | if (dev->driver != &w1_slave_driver || !sl) | 422 | if (dev->driver != &w1_slave_driver || !sl) |
424 | return 0; | 423 | return 0; |
425 | 424 | ||
426 | err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, | 425 | err = add_uevent_var(env, "W1_FID=%02X", sl->reg_num.family); |
427 | &cur_len, "W1_FID=%02X", sl->reg_num.family); | ||
428 | if (err) | 426 | if (err) |
429 | return err; | 427 | return err; |
430 | 428 | ||
431 | err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, | 429 | err = add_uevent_var(env, "W1_SLAVE_ID=%024LX", |
432 | &cur_len, "W1_SLAVE_ID=%024LX", | 430 | (unsigned long long)sl->reg_num.id); |
433 | (unsigned long long)sl->reg_num.id); | ||
434 | envp[cur_index] = NULL; | ||
435 | if (err) | 431 | if (err) |
436 | return err; | 432 | return err; |
437 | 433 | ||
438 | return 0; | 434 | return 0; |
439 | }; | 435 | }; |
440 | #else | 436 | #else |
441 | static int w1_uevent(struct device *dev, char **envp, int num_envp, | 437 | static int w1_uevent(struct device *dev, struct kobj_uevent_env *env) |
442 | char *buffer, int buffer_size) | ||
443 | { | 438 | { |
444 | return 0; | 439 | return 0; |
445 | } | 440 | } |