diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-29 20:36:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:44:31 -0500 |
commit | 1e0b2cf933ebf32494eba3f668859ba57f06a951 (patch) | |
tree | b8d9a3b41a452fb922cd3425e67ea8278c128c70 /drivers/base | |
parent | 210272a28465a7a31bcd580d2f9529f924965aa5 (diff) |
driver core: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/attribute_container.c | 2 | ||||
-rw-r--r-- | drivers/base/bus.c | 12 | ||||
-rw-r--r-- | drivers/base/core.c | 36 | ||||
-rw-r--r-- | drivers/base/dd.c | 12 | ||||
-rw-r--r-- | drivers/base/firmware_class.c | 8 | ||||
-rw-r--r-- | drivers/base/isa.c | 7 | ||||
-rw-r--r-- | drivers/base/platform.c | 15 | ||||
-rw-r--r-- | drivers/base/power/main.c | 2 | ||||
-rw-r--r-- | drivers/base/power/trace.c | 4 |
9 files changed, 45 insertions, 53 deletions
diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index f57652db0a2a..b9cda053d3c0 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c | |||
@@ -167,7 +167,7 @@ attribute_container_add_device(struct device *dev, | |||
167 | ic->classdev.parent = get_device(dev); | 167 | ic->classdev.parent = get_device(dev); |
168 | ic->classdev.class = cont->class; | 168 | ic->classdev.class = cont->class; |
169 | cont->class->dev_release = attribute_container_release; | 169 | cont->class->dev_release = attribute_container_release; |
170 | strcpy(ic->classdev.bus_id, dev->bus_id); | 170 | dev_set_name(&ic->classdev, dev_name(dev)); |
171 | if (fn) | 171 | if (fn) |
172 | fn(cont, dev, &ic->classdev); | 172 | fn(cont, dev, &ic->classdev); |
173 | else | 173 | else |
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 5aee1c0169ea..83f32b891fa9 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -333,7 +333,7 @@ static int match_name(struct device *dev, void *data) | |||
333 | { | 333 | { |
334 | const char *name = data; | 334 | const char *name = data; |
335 | 335 | ||
336 | return sysfs_streq(name, dev->bus_id); | 336 | return sysfs_streq(name, dev_name(dev)); |
337 | } | 337 | } |
338 | 338 | ||
339 | /** | 339 | /** |
@@ -461,12 +461,12 @@ int bus_add_device(struct device *dev) | |||
461 | int error = 0; | 461 | int error = 0; |
462 | 462 | ||
463 | if (bus) { | 463 | if (bus) { |
464 | pr_debug("bus: '%s': add device %s\n", bus->name, dev->bus_id); | 464 | pr_debug("bus: '%s': add device %s\n", bus->name, dev_name(dev)); |
465 | error = device_add_attrs(bus, dev); | 465 | error = device_add_attrs(bus, dev); |
466 | if (error) | 466 | if (error) |
467 | goto out_put; | 467 | goto out_put; |
468 | error = sysfs_create_link(&bus->p->devices_kset->kobj, | 468 | error = sysfs_create_link(&bus->p->devices_kset->kobj, |
469 | &dev->kobj, dev->bus_id); | 469 | &dev->kobj, dev_name(dev)); |
470 | if (error) | 470 | if (error) |
471 | goto out_id; | 471 | goto out_id; |
472 | error = sysfs_create_link(&dev->kobj, | 472 | error = sysfs_create_link(&dev->kobj, |
@@ -482,7 +482,7 @@ int bus_add_device(struct device *dev) | |||
482 | out_deprecated: | 482 | out_deprecated: |
483 | sysfs_remove_link(&dev->kobj, "subsystem"); | 483 | sysfs_remove_link(&dev->kobj, "subsystem"); |
484 | out_subsys: | 484 | out_subsys: |
485 | sysfs_remove_link(&bus->p->devices_kset->kobj, dev->bus_id); | 485 | sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev)); |
486 | out_id: | 486 | out_id: |
487 | device_remove_attrs(bus, dev); | 487 | device_remove_attrs(bus, dev); |
488 | out_put: | 488 | out_put: |
@@ -526,13 +526,13 @@ void bus_remove_device(struct device *dev) | |||
526 | sysfs_remove_link(&dev->kobj, "subsystem"); | 526 | sysfs_remove_link(&dev->kobj, "subsystem"); |
527 | remove_deprecated_bus_links(dev); | 527 | remove_deprecated_bus_links(dev); |
528 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, | 528 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, |
529 | dev->bus_id); | 529 | dev_name(dev)); |
530 | device_remove_attrs(dev->bus, dev); | 530 | device_remove_attrs(dev->bus, dev); |
531 | if (klist_node_attached(&dev->knode_bus)) | 531 | if (klist_node_attached(&dev->knode_bus)) |
532 | klist_del(&dev->knode_bus); | 532 | klist_del(&dev->knode_bus); |
533 | 533 | ||
534 | pr_debug("bus: '%s': remove device %s\n", | 534 | pr_debug("bus: '%s': remove device %s\n", |
535 | dev->bus->name, dev->bus_id); | 535 | dev->bus->name, dev_name(dev)); |
536 | device_release_driver(dev); | 536 | device_release_driver(dev); |
537 | bus_put(dev->bus); | 537 | bus_put(dev->bus); |
538 | } | 538 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 8c2cc2648f5a..14aa2b6953c9 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -119,7 +119,7 @@ static void device_release(struct kobject *kobj) | |||
119 | else | 119 | else |
120 | WARN(1, KERN_ERR "Device '%s' does not have a release() " | 120 | WARN(1, KERN_ERR "Device '%s' does not have a release() " |
121 | "function, it is broken and must be fixed.\n", | 121 | "function, it is broken and must be fixed.\n", |
122 | dev->bus_id); | 122 | dev_name(dev)); |
123 | } | 123 | } |
124 | 124 | ||
125 | static struct kobj_type device_ktype = { | 125 | static struct kobj_type device_ktype = { |
@@ -209,7 +209,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
209 | retval = dev->bus->uevent(dev, env); | 209 | retval = dev->bus->uevent(dev, env); |
210 | if (retval) | 210 | if (retval) |
211 | pr_debug("device: '%s': %s: bus uevent() returned %d\n", | 211 | pr_debug("device: '%s': %s: bus uevent() returned %d\n", |
212 | dev->bus_id, __func__, retval); | 212 | dev_name(dev), __func__, retval); |
213 | } | 213 | } |
214 | 214 | ||
215 | /* have the class specific function add its stuff */ | 215 | /* have the class specific function add its stuff */ |
@@ -217,7 +217,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
217 | retval = dev->class->dev_uevent(dev, env); | 217 | retval = dev->class->dev_uevent(dev, env); |
218 | if (retval) | 218 | if (retval) |
219 | pr_debug("device: '%s': %s: class uevent() " | 219 | pr_debug("device: '%s': %s: class uevent() " |
220 | "returned %d\n", dev->bus_id, | 220 | "returned %d\n", dev_name(dev), |
221 | __func__, retval); | 221 | __func__, retval); |
222 | } | 222 | } |
223 | 223 | ||
@@ -226,7 +226,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
226 | retval = dev->type->uevent(dev, env); | 226 | retval = dev->type->uevent(dev, env); |
227 | if (retval) | 227 | if (retval) |
228 | pr_debug("device: '%s': %s: dev_type uevent() " | 228 | pr_debug("device: '%s': %s: dev_type uevent() " |
229 | "returned %d\n", dev->bus_id, | 229 | "returned %d\n", dev_name(dev), |
230 | __func__, retval); | 230 | __func__, retval); |
231 | } | 231 | } |
232 | 232 | ||
@@ -672,7 +672,7 @@ static int device_add_class_symlinks(struct device *dev) | |||
672 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | 672 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && |
673 | device_is_not_partition(dev)) { | 673 | device_is_not_partition(dev)) { |
674 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, | 674 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, |
675 | &dev->kobj, dev->bus_id); | 675 | &dev->kobj, dev_name(dev)); |
676 | if (error) | 676 | if (error) |
677 | goto out_subsys; | 677 | goto out_subsys; |
678 | } | 678 | } |
@@ -712,11 +712,11 @@ out_busid: | |||
712 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | 712 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && |
713 | device_is_not_partition(dev)) | 713 | device_is_not_partition(dev)) |
714 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, | 714 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, |
715 | dev->bus_id); | 715 | dev_name(dev)); |
716 | #else | 716 | #else |
717 | /* link in the class directory pointing to the device */ | 717 | /* link in the class directory pointing to the device */ |
718 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, | 718 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, |
719 | &dev->kobj, dev->bus_id); | 719 | &dev->kobj, dev_name(dev)); |
720 | if (error) | 720 | if (error) |
721 | goto out_subsys; | 721 | goto out_subsys; |
722 | 722 | ||
@@ -729,7 +729,7 @@ out_busid: | |||
729 | return 0; | 729 | return 0; |
730 | 730 | ||
731 | out_busid: | 731 | out_busid: |
732 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev->bus_id); | 732 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev)); |
733 | #endif | 733 | #endif |
734 | 734 | ||
735 | out_subsys: | 735 | out_subsys: |
@@ -758,12 +758,12 @@ static void device_remove_class_symlinks(struct device *dev) | |||
758 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | 758 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && |
759 | device_is_not_partition(dev)) | 759 | device_is_not_partition(dev)) |
760 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, | 760 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, |
761 | dev->bus_id); | 761 | dev_name(dev)); |
762 | #else | 762 | #else |
763 | if (dev->parent && device_is_not_partition(dev)) | 763 | if (dev->parent && device_is_not_partition(dev)) |
764 | sysfs_remove_link(&dev->kobj, "device"); | 764 | sysfs_remove_link(&dev->kobj, "device"); |
765 | 765 | ||
766 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev->bus_id); | 766 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev)); |
767 | #endif | 767 | #endif |
768 | 768 | ||
769 | sysfs_remove_link(&dev->kobj, "subsystem"); | 769 | sysfs_remove_link(&dev->kobj, "subsystem"); |
@@ -866,7 +866,7 @@ int device_add(struct device *dev) | |||
866 | if (!strlen(dev->bus_id)) | 866 | if (!strlen(dev->bus_id)) |
867 | goto done; | 867 | goto done; |
868 | 868 | ||
869 | pr_debug("device: '%s': %s\n", dev->bus_id, __func__); | 869 | pr_debug("device: '%s': %s\n", dev_name(dev), __func__); |
870 | 870 | ||
871 | parent = get_device(dev->parent); | 871 | parent = get_device(dev->parent); |
872 | setup_parent(dev, parent); | 872 | setup_parent(dev, parent); |
@@ -876,7 +876,7 @@ int device_add(struct device *dev) | |||
876 | set_dev_node(dev, dev_to_node(parent)); | 876 | set_dev_node(dev, dev_to_node(parent)); |
877 | 877 | ||
878 | /* first, register with generic layer. */ | 878 | /* first, register with generic layer. */ |
879 | error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id); | 879 | error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev)); |
880 | if (error) | 880 | if (error) |
881 | goto Error; | 881 | goto Error; |
882 | 882 | ||
@@ -1086,7 +1086,7 @@ void device_del(struct device *dev) | |||
1086 | */ | 1086 | */ |
1087 | void device_unregister(struct device *dev) | 1087 | void device_unregister(struct device *dev) |
1088 | { | 1088 | { |
1089 | pr_debug("device: '%s': %s\n", dev->bus_id, __func__); | 1089 | pr_debug("device: '%s': %s\n", dev_name(dev), __func__); |
1090 | device_del(dev); | 1090 | device_del(dev); |
1091 | put_device(dev); | 1091 | put_device(dev); |
1092 | } | 1092 | } |
@@ -1199,7 +1199,7 @@ EXPORT_SYMBOL_GPL(device_remove_file); | |||
1199 | 1199 | ||
1200 | static void device_create_release(struct device *dev) | 1200 | static void device_create_release(struct device *dev) |
1201 | { | 1201 | { |
1202 | pr_debug("device: '%s': %s\n", dev->bus_id, __func__); | 1202 | pr_debug("device: '%s': %s\n", dev_name(dev), __func__); |
1203 | kfree(dev); | 1203 | kfree(dev); |
1204 | } | 1204 | } |
1205 | 1205 | ||
@@ -1344,7 +1344,7 @@ int device_rename(struct device *dev, char *new_name) | |||
1344 | if (!dev) | 1344 | if (!dev) |
1345 | return -EINVAL; | 1345 | return -EINVAL; |
1346 | 1346 | ||
1347 | pr_debug("device: '%s': %s: renaming to '%s'\n", dev->bus_id, | 1347 | pr_debug("device: '%s': %s: renaming to '%s'\n", dev_name(dev), |
1348 | __func__, new_name); | 1348 | __func__, new_name); |
1349 | 1349 | ||
1350 | #ifdef CONFIG_SYSFS_DEPRECATED | 1350 | #ifdef CONFIG_SYSFS_DEPRECATED |
@@ -1381,7 +1381,7 @@ int device_rename(struct device *dev, char *new_name) | |||
1381 | #else | 1381 | #else |
1382 | if (dev->class) { | 1382 | if (dev->class) { |
1383 | error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj, | 1383 | error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj, |
1384 | &dev->kobj, dev->bus_id); | 1384 | &dev->kobj, dev_name(dev)); |
1385 | if (error) | 1385 | if (error) |
1386 | goto out; | 1386 | goto out; |
1387 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, | 1387 | sysfs_remove_link(&dev->class->p->class_subsys.kobj, |
@@ -1459,8 +1459,8 @@ int device_move(struct device *dev, struct device *new_parent) | |||
1459 | new_parent = get_device(new_parent); | 1459 | new_parent = get_device(new_parent); |
1460 | new_parent_kobj = get_device_parent(dev, new_parent); | 1460 | new_parent_kobj = get_device_parent(dev, new_parent); |
1461 | 1461 | ||
1462 | pr_debug("device: '%s': %s: moving to '%s'\n", dev->bus_id, | 1462 | pr_debug("device: '%s': %s: moving to '%s'\n", dev_name(dev), |
1463 | __func__, new_parent ? new_parent->bus_id : "<NULL>"); | 1463 | __func__, new_parent ? dev_name(new_parent) : "<NULL>"); |
1464 | error = kobject_move(&dev->kobj, new_parent_kobj); | 1464 | error = kobject_move(&dev->kobj, new_parent_kobj); |
1465 | if (error) { | 1465 | if (error) { |
1466 | cleanup_glue_dir(dev, new_parent_kobj); | 1466 | cleanup_glue_dir(dev, new_parent_kobj); |
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 20febc00a525..17a8e45cf9c6 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -34,7 +34,7 @@ static void driver_bound(struct device *dev) | |||
34 | return; | 34 | return; |
35 | } | 35 | } |
36 | 36 | ||
37 | pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->bus_id, | 37 | pr_debug("driver: '%s': %s: bound to device '%s'\n", dev_name(dev), |
38 | __func__, dev->driver->name); | 38 | __func__, dev->driver->name); |
39 | 39 | ||
40 | if (dev->bus) | 40 | if (dev->bus) |
@@ -104,13 +104,13 @@ static int really_probe(struct device *dev, struct device_driver *drv) | |||
104 | 104 | ||
105 | atomic_inc(&probe_count); | 105 | atomic_inc(&probe_count); |
106 | pr_debug("bus: '%s': %s: probing driver %s with device %s\n", | 106 | pr_debug("bus: '%s': %s: probing driver %s with device %s\n", |
107 | drv->bus->name, __func__, drv->name, dev->bus_id); | 107 | drv->bus->name, __func__, drv->name, dev_name(dev)); |
108 | WARN_ON(!list_empty(&dev->devres_head)); | 108 | WARN_ON(!list_empty(&dev->devres_head)); |
109 | 109 | ||
110 | dev->driver = drv; | 110 | dev->driver = drv; |
111 | if (driver_sysfs_add(dev)) { | 111 | if (driver_sysfs_add(dev)) { |
112 | printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n", | 112 | printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n", |
113 | __func__, dev->bus_id); | 113 | __func__, dev_name(dev)); |
114 | goto probe_failed; | 114 | goto probe_failed; |
115 | } | 115 | } |
116 | 116 | ||
@@ -127,7 +127,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) | |||
127 | driver_bound(dev); | 127 | driver_bound(dev); |
128 | ret = 1; | 128 | ret = 1; |
129 | pr_debug("bus: '%s': %s: bound device %s to driver %s\n", | 129 | pr_debug("bus: '%s': %s: bound device %s to driver %s\n", |
130 | drv->bus->name, __func__, dev->bus_id, drv->name); | 130 | drv->bus->name, __func__, dev_name(dev), drv->name); |
131 | goto done; | 131 | goto done; |
132 | 132 | ||
133 | probe_failed: | 133 | probe_failed: |
@@ -139,7 +139,7 @@ probe_failed: | |||
139 | /* driver matched but the probe failed */ | 139 | /* driver matched but the probe failed */ |
140 | printk(KERN_WARNING | 140 | printk(KERN_WARNING |
141 | "%s: probe of %s failed with error %d\n", | 141 | "%s: probe of %s failed with error %d\n", |
142 | drv->name, dev->bus_id, ret); | 142 | drv->name, dev_name(dev), ret); |
143 | } | 143 | } |
144 | /* | 144 | /* |
145 | * Ignore errors returned by ->probe so that the next driver can try | 145 | * Ignore errors returned by ->probe so that the next driver can try |
@@ -194,7 +194,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev) | |||
194 | goto done; | 194 | goto done; |
195 | 195 | ||
196 | pr_debug("bus: '%s': %s: matched device %s with driver %s\n", | 196 | pr_debug("bus: '%s': %s: matched device %s with driver %s\n", |
197 | drv->bus->name, __func__, dev->bus_id, drv->name); | 197 | drv->bus->name, __func__, dev_name(dev), drv->name); |
198 | 198 | ||
199 | ret = really_probe(dev, drv); | 199 | ret = really_probe(dev, drv); |
200 | 200 | ||
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index b7e571031ecd..44699d9dd85c 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -291,12 +291,6 @@ firmware_class_timeout(u_long data) | |||
291 | fw_load_abort(fw_priv); | 291 | fw_load_abort(fw_priv); |
292 | } | 292 | } |
293 | 293 | ||
294 | static inline void fw_setup_device_id(struct device *f_dev, struct device *dev) | ||
295 | { | ||
296 | /* XXX warning we should watch out for name collisions */ | ||
297 | strlcpy(f_dev->bus_id, dev->bus_id, BUS_ID_SIZE); | ||
298 | } | ||
299 | |||
300 | static int fw_register_device(struct device **dev_p, const char *fw_name, | 294 | static int fw_register_device(struct device **dev_p, const char *fw_name, |
301 | struct device *device) | 295 | struct device *device) |
302 | { | 296 | { |
@@ -321,7 +315,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, | |||
321 | fw_priv->timeout.data = (u_long) fw_priv; | 315 | fw_priv->timeout.data = (u_long) fw_priv; |
322 | init_timer(&fw_priv->timeout); | 316 | init_timer(&fw_priv->timeout); |
323 | 317 | ||
324 | fw_setup_device_id(f_dev, device); | 318 | dev_set_name(f_dev, dev_name(device)); |
325 | f_dev->parent = device; | 319 | f_dev->parent = device; |
326 | f_dev->class = &firmware_class; | 320 | f_dev->class = &firmware_class; |
327 | dev_set_drvdata(f_dev, fw_priv); | 321 | dev_set_drvdata(f_dev, fw_priv); |
diff --git a/drivers/base/isa.c b/drivers/base/isa.c index efd577574948..479694b6cbe3 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/isa.h> | 11 | #include <linux/isa.h> |
12 | 12 | ||
13 | static struct device isa_bus = { | 13 | static struct device isa_bus = { |
14 | .bus_id = "isa" | 14 | .init_name = "isa" |
15 | }; | 15 | }; |
16 | 16 | ||
17 | struct isa_dev { | 17 | struct isa_dev { |
@@ -135,9 +135,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) | |||
135 | isa_dev->dev.parent = &isa_bus; | 135 | isa_dev->dev.parent = &isa_bus; |
136 | isa_dev->dev.bus = &isa_bus_type; | 136 | isa_dev->dev.bus = &isa_bus_type; |
137 | 137 | ||
138 | snprintf(isa_dev->dev.bus_id, BUS_ID_SIZE, "%s.%u", | 138 | dev_set_name(&isa_dev->dev, "%s.%u", |
139 | isa_driver->driver.name, id); | 139 | isa_driver->driver.name, id); |
140 | |||
141 | isa_dev->dev.platform_data = isa_driver; | 140 | isa_dev->dev.platform_data = isa_driver; |
142 | isa_dev->dev.release = isa_dev_release; | 141 | isa_dev->dev.release = isa_dev_release; |
143 | isa_dev->id = id; | 142 | isa_dev->id = id; |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 6c743b6008d9..349a1013603f 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -24,7 +24,7 @@ | |||
24 | driver)) | 24 | driver)) |
25 | 25 | ||
26 | struct device platform_bus = { | 26 | struct device platform_bus = { |
27 | .bus_id = "platform", | 27 | .init_name = "platform", |
28 | }; | 28 | }; |
29 | EXPORT_SYMBOL_GPL(platform_bus); | 29 | EXPORT_SYMBOL_GPL(platform_bus); |
30 | 30 | ||
@@ -242,16 +242,15 @@ int platform_device_add(struct platform_device *pdev) | |||
242 | pdev->dev.bus = &platform_bus_type; | 242 | pdev->dev.bus = &platform_bus_type; |
243 | 243 | ||
244 | if (pdev->id != -1) | 244 | if (pdev->id != -1) |
245 | snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name, | 245 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); |
246 | pdev->id); | ||
247 | else | 246 | else |
248 | strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE); | 247 | dev_set_name(&pdev->dev, pdev->name); |
249 | 248 | ||
250 | for (i = 0; i < pdev->num_resources; i++) { | 249 | for (i = 0; i < pdev->num_resources; i++) { |
251 | struct resource *p, *r = &pdev->resource[i]; | 250 | struct resource *p, *r = &pdev->resource[i]; |
252 | 251 | ||
253 | if (r->name == NULL) | 252 | if (r->name == NULL) |
254 | r->name = pdev->dev.bus_id; | 253 | r->name = dev_name(&pdev->dev); |
255 | 254 | ||
256 | p = r->parent; | 255 | p = r->parent; |
257 | if (!p) { | 256 | if (!p) { |
@@ -264,14 +263,14 @@ int platform_device_add(struct platform_device *pdev) | |||
264 | if (p && insert_resource(p, r)) { | 263 | if (p && insert_resource(p, r)) { |
265 | printk(KERN_ERR | 264 | printk(KERN_ERR |
266 | "%s: failed to claim resource %d\n", | 265 | "%s: failed to claim resource %d\n", |
267 | pdev->dev.bus_id, i); | 266 | dev_name(&pdev->dev), i); |
268 | ret = -EBUSY; | 267 | ret = -EBUSY; |
269 | goto failed; | 268 | goto failed; |
270 | } | 269 | } |
271 | } | 270 | } |
272 | 271 | ||
273 | pr_debug("Registering platform device '%s'. Parent at %s\n", | 272 | pr_debug("Registering platform device '%s'. Parent at %s\n", |
274 | pdev->dev.bus_id, pdev->dev.parent->bus_id); | 273 | dev_name(&pdev->dev), dev_name(pdev->dev.parent)); |
275 | 274 | ||
276 | ret = device_add(&pdev->dev); | 275 | ret = device_add(&pdev->dev); |
277 | if (ret == 0) | 276 | if (ret == 0) |
@@ -607,7 +606,7 @@ static int platform_match(struct device *dev, struct device_driver *drv) | |||
607 | struct platform_device *pdev; | 606 | struct platform_device *pdev; |
608 | 607 | ||
609 | pdev = container_of(dev, struct platform_device, dev); | 608 | pdev = container_of(dev, struct platform_device, dev); |
610 | return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0); | 609 | return (strcmp(pdev->name, drv->name) == 0); |
611 | } | 610 | } |
612 | 611 | ||
613 | #ifdef CONFIG_PM_SLEEP | 612 | #ifdef CONFIG_PM_SLEEP |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index a8e4dcbcaf7a..670c9d6c1407 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -76,7 +76,7 @@ void device_pm_add(struct device *dev) | |||
76 | if (dev->parent) { | 76 | if (dev->parent) { |
77 | if (dev->parent->power.status >= DPM_SUSPENDING) | 77 | if (dev->parent->power.status >= DPM_SUSPENDING) |
78 | dev_warn(dev, "parent %s should not be sleeping\n", | 78 | dev_warn(dev, "parent %s should not be sleeping\n", |
79 | dev->parent->bus_id); | 79 | dev_name(dev->parent)); |
80 | } else if (transition_started) { | 80 | } else if (transition_started) { |
81 | /* | 81 | /* |
82 | * We refuse to register parentless devices while a PM | 82 | * We refuse to register parentless devices while a PM |
diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c index 2aa6e8fc4def..0a1a2c4dbc6e 100644 --- a/drivers/base/power/trace.c +++ b/drivers/base/power/trace.c | |||
@@ -140,7 +140,7 @@ static unsigned int hash_string(unsigned int seed, const char *data, unsigned in | |||
140 | 140 | ||
141 | void set_trace_device(struct device *dev) | 141 | void set_trace_device(struct device *dev) |
142 | { | 142 | { |
143 | dev_hash_value = hash_string(DEVSEED, dev->bus_id, DEVHASH); | 143 | dev_hash_value = hash_string(DEVSEED, dev_name(dev), DEVHASH); |
144 | } | 144 | } |
145 | EXPORT_SYMBOL(set_trace_device); | 145 | EXPORT_SYMBOL(set_trace_device); |
146 | 146 | ||
@@ -192,7 +192,7 @@ static int show_dev_hash(unsigned int value) | |||
192 | 192 | ||
193 | while (entry != &dpm_list) { | 193 | while (entry != &dpm_list) { |
194 | struct device * dev = to_device(entry); | 194 | struct device * dev = to_device(entry); |
195 | unsigned int hash = hash_string(DEVSEED, dev->bus_id, DEVHASH); | 195 | unsigned int hash = hash_string(DEVSEED, dev_name(dev), DEVHASH); |
196 | if (hash == value) { | 196 | if (hash == value) { |
197 | dev_info(dev, "hash matches\n"); | 197 | dev_info(dev, "hash matches\n"); |
198 | match++; | 198 | match++; |