aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-05-18 23:31:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-12 18:27:32 -0400
commit526be41625a8b2282d5720dcb19f927edbf193b4 (patch)
treea6b5e3e3f77cf1da966a071bb64f22bc37154717 /drivers/w1
parent59d4467be405316916a4087d5b02d99196eeef04 (diff)
w1: cleanup w1_uevent
There were some return statements around in the w1_uevent, used goto to cleanup those return statements with the help of err variable, and also removed a semi colon at the end of the w1_uevent's closing brace. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 69075c3dfc73..79e488db5104 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -557,7 +557,7 @@ static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
557 struct w1_master *md = NULL; 557 struct w1_master *md = NULL;
558 struct w1_slave *sl = NULL; 558 struct w1_slave *sl = NULL;
559 char *event_owner, *name; 559 char *event_owner, *name;
560 int err; 560 int err = 0;
561 561
562 if (dev->driver == &w1_master_driver) { 562 if (dev->driver == &w1_master_driver) {
563 md = container_of(dev, struct w1_master, dev); 563 md = container_of(dev, struct w1_master, dev);
@@ -576,19 +576,17 @@ static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
576 event_owner, name, dev_name(dev)); 576 event_owner, name, dev_name(dev));
577 577
578 if (dev->driver != &w1_slave_driver || !sl) 578 if (dev->driver != &w1_slave_driver || !sl)
579 return 0; 579 goto end;
580 580
581 err = add_uevent_var(env, "W1_FID=%02X", sl->reg_num.family); 581 err = add_uevent_var(env, "W1_FID=%02X", sl->reg_num.family);
582 if (err) 582 if (err)
583 return err; 583 goto end;
584 584
585 err = add_uevent_var(env, "W1_SLAVE_ID=%024LX", 585 err = add_uevent_var(env, "W1_SLAVE_ID=%024LX",
586 (unsigned long long)sl->reg_num.id); 586 (unsigned long long)sl->reg_num.id);
587 if (err) 587end:
588 return err; 588 return err;
589 589}
590 return 0;
591};
592#else 590#else
593static int w1_uevent(struct device *dev, struct kobj_uevent_env *env) 591static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
594{ 592{