diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-01-06 13:44:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:44:34 -0500 |
commit | 40f91de6a1d65a2d0ce8bc296ed0a2d53d63c845 (patch) | |
tree | 5feb71564431547b20cb786ae5365a1f83b227ff | |
parent | 2a678cc53977c97aaf666c338f6312b7bbd3406d (diff) |
w1: struct device - replace bus_id with dev_name(), dev_set_name()
CC: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/w1/w1.c | 19 | ||||
-rw-r--r-- | drivers/w1/w1_int.c | 3 |
2 files changed, 10 insertions, 12 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 3b615d4022ee..acc7e3b7fe17 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -197,7 +197,7 @@ struct device_driver w1_master_driver = { | |||
197 | struct device w1_master_device = { | 197 | struct device w1_master_device = { |
198 | .parent = NULL, | 198 | .parent = NULL, |
199 | .bus = &w1_bus_type, | 199 | .bus = &w1_bus_type, |
200 | .bus_id = "w1 bus master", | 200 | .init_name = "w1 bus master", |
201 | .driver = &w1_master_driver, | 201 | .driver = &w1_master_driver, |
202 | .release = &w1_master_release | 202 | .release = &w1_master_release |
203 | }; | 203 | }; |
@@ -211,7 +211,7 @@ static struct device_driver w1_slave_driver = { | |||
211 | struct device w1_slave_device = { | 211 | struct device w1_slave_device = { |
212 | .parent = NULL, | 212 | .parent = NULL, |
213 | .bus = &w1_bus_type, | 213 | .bus = &w1_bus_type, |
214 | .bus_id = "w1 bus slave", | 214 | .init_name = "w1 bus slave", |
215 | .driver = &w1_slave_driver, | 215 | .driver = &w1_slave_driver, |
216 | .release = &w1_slave_release | 216 | .release = &w1_slave_release |
217 | }; | 217 | }; |
@@ -573,7 +573,7 @@ static int w1_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
573 | } | 573 | } |
574 | 574 | ||
575 | dev_dbg(dev, "Hotplug event for %s %s, bus_id=%s.\n", | 575 | dev_dbg(dev, "Hotplug event for %s %s, bus_id=%s.\n", |
576 | event_owner, name, dev->bus_id); | 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 | return 0; |
@@ -605,8 +605,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
605 | sl->dev.bus = &w1_bus_type; | 605 | sl->dev.bus = &w1_bus_type; |
606 | sl->dev.release = &w1_slave_release; | 606 | sl->dev.release = &w1_slave_release; |
607 | 607 | ||
608 | snprintf(&sl->dev.bus_id[0], sizeof(sl->dev.bus_id), | 608 | dev_set_name(&sl->dev, "%02x-%012llx", |
609 | "%02x-%012llx", | ||
610 | (unsigned int) sl->reg_num.family, | 609 | (unsigned int) sl->reg_num.family, |
611 | (unsigned long long) sl->reg_num.id); | 610 | (unsigned long long) sl->reg_num.id); |
612 | snprintf(&sl->name[0], sizeof(sl->name), | 611 | snprintf(&sl->name[0], sizeof(sl->name), |
@@ -615,13 +614,13 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
615 | (unsigned long long) sl->reg_num.id); | 614 | (unsigned long long) sl->reg_num.id); |
616 | 615 | ||
617 | dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__, | 616 | dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__, |
618 | &sl->dev.bus_id[0], sl); | 617 | dev_name(&sl->dev), sl); |
619 | 618 | ||
620 | err = device_register(&sl->dev); | 619 | err = device_register(&sl->dev); |
621 | if (err < 0) { | 620 | if (err < 0) { |
622 | dev_err(&sl->dev, | 621 | dev_err(&sl->dev, |
623 | "Device registration [%s] failed. err=%d\n", | 622 | "Device registration [%s] failed. err=%d\n", |
624 | sl->dev.bus_id, err); | 623 | dev_name(&sl->dev), err); |
625 | return err; | 624 | return err; |
626 | } | 625 | } |
627 | 626 | ||
@@ -630,7 +629,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
630 | if (err < 0) { | 629 | if (err < 0) { |
631 | dev_err(&sl->dev, | 630 | dev_err(&sl->dev, |
632 | "sysfs file creation for [%s] failed. err=%d\n", | 631 | "sysfs file creation for [%s] failed. err=%d\n", |
633 | sl->dev.bus_id, err); | 632 | dev_name(&sl->dev), err); |
634 | goto out_unreg; | 633 | goto out_unreg; |
635 | } | 634 | } |
636 | 635 | ||
@@ -639,7 +638,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
639 | if (err < 0) { | 638 | if (err < 0) { |
640 | dev_err(&sl->dev, | 639 | dev_err(&sl->dev, |
641 | "sysfs file creation for [%s] failed. err=%d\n", | 640 | "sysfs file creation for [%s] failed. err=%d\n", |
642 | sl->dev.bus_id, err); | 641 | dev_name(&sl->dev), err); |
643 | goto out_rem1; | 642 | goto out_rem1; |
644 | } | 643 | } |
645 | 644 | ||
@@ -648,7 +647,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl) | |||
648 | ((err = sl->family->fops->add_slave(sl)) < 0)) { | 647 | ((err = sl->family->fops->add_slave(sl)) < 0)) { |
649 | dev_err(&sl->dev, | 648 | dev_err(&sl->dev, |
650 | "sysfs file creation for [%s] failed. err=%d\n", | 649 | "sysfs file creation for [%s] failed. err=%d\n", |
651 | sl->dev.bus_id, err); | 650 | dev_name(&sl->dev), err); |
652 | goto out_rem2; | 651 | goto out_rem2; |
653 | } | 652 | } |
654 | 653 | ||
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index a3a54567bfba..4a46ed58ece9 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
@@ -75,8 +75,7 @@ static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, | |||
75 | mutex_init(&dev->mutex); | 75 | mutex_init(&dev->mutex); |
76 | 76 | ||
77 | memcpy(&dev->dev, device, sizeof(struct device)); | 77 | memcpy(&dev->dev, device, sizeof(struct device)); |
78 | snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), | 78 | dev_set_name(&dev->dev, "w1_bus_master%u", dev->id); |
79 | "w1_bus_master%u", dev->id); | ||
80 | snprintf(dev->name, sizeof(dev->name), "w1_bus_master%u", dev->id); | 79 | snprintf(dev->name, sizeof(dev->name), "w1_bus_master%u", dev->id); |
81 | 80 | ||
82 | dev->driver = driver; | 81 | dev->driver = driver; |