aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 20:02:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 20:02:07 -0500
commit40d7ee5d162203b40b5f4fbb312ab016edddb97f (patch)
tree432db33df85f7f244676127a189a828dfbf2877b /drivers/w1
parent5fec8bdbf9a1c4df4ad3f20e52aa2d8caed490c8 (diff)
parentb8ac9fc0e8cda9f9776019c5b0464b0c6d2d4c90 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (60 commits) uio: make uio_info's name and version const UIO: Documentation for UIO ioport info handling UIO: Pass information about ioports to userspace (V2) UIO: uio_pdrv_genirq: allow custom irq_flags UIO: use pci_ioremap_bar() in drivers/uio arm: struct device - replace bus_id with dev_name(), dev_set_name() libata: struct device - replace bus_id with dev_name(), dev_set_name() avr: struct device - replace bus_id with dev_name(), dev_set_name() block: struct device - replace bus_id with dev_name(), dev_set_name() chris: struct device - replace bus_id with dev_name(), dev_set_name() dmi: struct device - replace bus_id with dev_name(), dev_set_name() gadget: struct device - replace bus_id with dev_name(), dev_set_name() gpio: struct device - replace bus_id with dev_name(), dev_set_name() gpu: struct device - replace bus_id with dev_name(), dev_set_name() hwmon: struct device - replace bus_id with dev_name(), dev_set_name() i2o: struct device - replace bus_id with dev_name(), dev_set_name() IA64: struct device - replace bus_id with dev_name(), dev_set_name() i7300_idle: struct device - replace bus_id with dev_name(), dev_set_name() infiniband: struct device - replace bus_id with dev_name(), dev_set_name() ISDN: struct device - replace bus_id with dev_name(), dev_set_name() ...
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c19
-rw-r--r--drivers/w1/w1_int.c3
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 = {
197struct device w1_master_device = { 197struct 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 = {
211struct device w1_slave_device = { 211struct 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;