diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-29 20:18:59 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-11-06 21:37:19 -0500 |
commit | 0794469da3f7b2093575cbdfc1108308dd3641ce (patch) | |
tree | 46a20312fa37dcc05ddba1a53b9ac7bab182c57c /drivers | |
parent | 457d2ee225801441e96f2e35894ec404572ad862 (diff) |
ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".
To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.
We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.
We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/ac.c | 2 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 6 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 8 | ||||
-rw-r--r-- | drivers/acpi/sleep/proc.c | 4 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 8 | ||||
-rw-r--r-- | drivers/acpi/wmi.c | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index d72a1b6c8a94..2d467326d9e0 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -242,7 +242,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data) | |||
242 | acpi_ac_get_state(ac); | 242 | acpi_ac_get_state(ac); |
243 | acpi_bus_generate_proc_event(device, event, (u32) ac->state); | 243 | acpi_bus_generate_proc_event(device, event, (u32) ac->state); |
244 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 244 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
245 | device->dev.bus_id, event, | 245 | dev_name(&device->dev), event, |
246 | (u32) ac->state); | 246 | (u32) ac->state); |
247 | #ifdef CONFIG_ACPI_SYSFS_POWER | 247 | #ifdef CONFIG_ACPI_SYSFS_POWER |
248 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); | 248 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index b2133e89ad9a..e68f2187ed64 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -782,7 +782,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) | |||
782 | acpi_bus_generate_proc_event(device, event, | 782 | acpi_bus_generate_proc_event(device, event, |
783 | acpi_battery_present(battery)); | 783 | acpi_battery_present(battery)); |
784 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 784 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
785 | device->dev.bus_id, event, | 785 | dev_name(&device->dev), event, |
786 | acpi_battery_present(battery)); | 786 | acpi_battery_present(battery)); |
787 | #ifdef CONFIG_ACPI_SYSFS_POWER | 787 | #ifdef CONFIG_ACPI_SYSFS_POWER |
788 | /* acpi_batter_update could remove power_supply object */ | 788 | /* acpi_batter_update could remove power_supply object */ |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 24a362f8034c..cf7e8856a4cd 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -761,20 +761,20 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) | |||
761 | acpi_bus_generate_proc_event(device, event, | 761 | acpi_bus_generate_proc_event(device, event, |
762 | pr->performance_platform_limit); | 762 | pr->performance_platform_limit); |
763 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 763 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
764 | device->dev.bus_id, event, | 764 | dev_name(&device->dev), event, |
765 | pr->performance_platform_limit); | 765 | pr->performance_platform_limit); |
766 | break; | 766 | break; |
767 | case ACPI_PROCESSOR_NOTIFY_POWER: | 767 | case ACPI_PROCESSOR_NOTIFY_POWER: |
768 | acpi_processor_cst_has_changed(pr); | 768 | acpi_processor_cst_has_changed(pr); |
769 | acpi_bus_generate_proc_event(device, event, 0); | 769 | acpi_bus_generate_proc_event(device, event, 0); |
770 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 770 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
771 | device->dev.bus_id, event, 0); | 771 | dev_name(&device->dev), event, 0); |
772 | break; | 772 | break; |
773 | case ACPI_PROCESSOR_NOTIFY_THROTTLING: | 773 | case ACPI_PROCESSOR_NOTIFY_THROTTLING: |
774 | acpi_processor_tstate_has_changed(pr); | 774 | acpi_processor_tstate_has_changed(pr); |
775 | acpi_bus_generate_proc_event(device, event, 0); | 775 | acpi_bus_generate_proc_event(device, event, 0); |
776 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 776 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
777 | device->dev.bus_id, event, 0); | 777 | dev_name(&device->dev), event, 0); |
778 | default: | 778 | default: |
779 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 779 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
780 | "Unsupported event [0x%x]\n", event)); | 780 | "Unsupported event [0x%x]\n", event)); |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index a9dda8e0f9f9..4dd1f31930b8 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -109,8 +109,7 @@ static int acpi_bus_hot_remove_device(void *context) | |||
109 | return 0; | 109 | return 0; |
110 | 110 | ||
111 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 111 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
112 | "Hot-removing device %s...\n", device->dev.bus_id)); | 112 | "Hot-removing device %s...\n", dev_name(&device->dev))); |
113 | |||
114 | 113 | ||
115 | if (acpi_bus_trim(device, 1)) { | 114 | if (acpi_bus_trim(device, 1)) { |
116 | printk(KERN_ERR PREFIX | 115 | printk(KERN_ERR PREFIX |
@@ -460,7 +459,7 @@ static int acpi_device_register(struct acpi_device *device, | |||
460 | acpi_device_bus_id->instance_no = 0; | 459 | acpi_device_bus_id->instance_no = 0; |
461 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); | 460 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); |
462 | } | 461 | } |
463 | sprintf(device->dev.bus_id, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); | 462 | dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); |
464 | 463 | ||
465 | if (device->parent) { | 464 | if (device->parent) { |
466 | list_add_tail(&device->node, &device->parent->children); | 465 | list_add_tail(&device->node, &device->parent->children); |
@@ -484,7 +483,8 @@ static int acpi_device_register(struct acpi_device *device, | |||
484 | 483 | ||
485 | result = acpi_device_setup_files(device); | 484 | result = acpi_device_setup_files(device); |
486 | if(result) | 485 | if(result) |
487 | printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n", device->dev.bus_id); | 486 | printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n", |
487 | dev_name(&device->dev)); | ||
488 | 488 | ||
489 | device->removal_type = ACPI_BUS_REMOVAL_NORMAL; | 489 | device->removal_type = ACPI_BUS_REMOVAL_NORMAL; |
490 | return 0; | 490 | return 0; |
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 631ee2ee2ca0..64e591ba86f2 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c | |||
@@ -366,8 +366,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) | |||
366 | dev->wakeup.state.enabled ? "enabled" : "disabled"); | 366 | dev->wakeup.state.enabled ? "enabled" : "disabled"); |
367 | if (ldev) | 367 | if (ldev) |
368 | seq_printf(seq, "%s:%s", | 368 | seq_printf(seq, "%s:%s", |
369 | ldev->bus ? ldev->bus->name : "no-bus", | 369 | dev_name(ldev) ? ldev->bus->name : "no-bus", |
370 | ldev->bus_id); | 370 | dev_name(ldev)); |
371 | seq_printf(seq, "\n"); | 371 | seq_printf(seq, "\n"); |
372 | put_device(ldev); | 372 | put_device(ldev); |
373 | 373 | ||
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index ad6cae938f0b..462b16878851 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -576,7 +576,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
576 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, | 576 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, |
577 | tz->trips.critical.flags.enabled); | 577 | tz->trips.critical.flags.enabled); |
578 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, | 578 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, |
579 | tz->device->dev.bus_id, | 579 | dev_name(&tz->device->dev), |
580 | ACPI_THERMAL_NOTIFY_CRITICAL, | 580 | ACPI_THERMAL_NOTIFY_CRITICAL, |
581 | tz->trips.critical.flags.enabled); | 581 | tz->trips.critical.flags.enabled); |
582 | 582 | ||
@@ -605,7 +605,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz) | |||
605 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, | 605 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, |
606 | tz->trips.hot.flags.enabled); | 606 | tz->trips.hot.flags.enabled); |
607 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, | 607 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, |
608 | tz->device->dev.bus_id, | 608 | dev_name(&tz->device->dev), |
609 | ACPI_THERMAL_NOTIFY_HOT, | 609 | ACPI_THERMAL_NOTIFY_HOT, |
610 | tz->trips.hot.flags.enabled); | 610 | tz->trips.hot.flags.enabled); |
611 | 611 | ||
@@ -1592,14 +1592,14 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) | |||
1592 | acpi_thermal_check(tz); | 1592 | acpi_thermal_check(tz); |
1593 | acpi_bus_generate_proc_event(device, event, 0); | 1593 | acpi_bus_generate_proc_event(device, event, 0); |
1594 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 1594 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
1595 | device->dev.bus_id, event, 0); | 1595 | dev_name(&device->dev), event, 0); |
1596 | break; | 1596 | break; |
1597 | case ACPI_THERMAL_NOTIFY_DEVICES: | 1597 | case ACPI_THERMAL_NOTIFY_DEVICES: |
1598 | acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); | 1598 | acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); |
1599 | acpi_thermal_check(tz); | 1599 | acpi_thermal_check(tz); |
1600 | acpi_bus_generate_proc_event(device, event, 0); | 1600 | acpi_bus_generate_proc_event(device, event, 0); |
1601 | acpi_bus_generate_netlink_event(device->pnp.device_class, | 1601 | acpi_bus_generate_netlink_event(device->pnp.device_class, |
1602 | device->dev.bus_id, event, 0); | 1602 | dev_name(&device->dev), event, 0); |
1603 | break; | 1603 | break; |
1604 | default: | 1604 | default: |
1605 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 1605 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c index 47cd7baf9b1b..8a8b377712c9 100644 --- a/drivers/acpi/wmi.c +++ b/drivers/acpi/wmi.c | |||
@@ -660,7 +660,7 @@ static void acpi_wmi_notify(acpi_handle handle, u32 event, void *data) | |||
660 | wblock->handler(event, wblock->handler_data); | 660 | wblock->handler(event, wblock->handler_data); |
661 | 661 | ||
662 | acpi_bus_generate_netlink_event( | 662 | acpi_bus_generate_netlink_event( |
663 | device->pnp.device_class, device->dev.bus_id, | 663 | device->pnp.device_class, dev_name(&device->dev), |
664 | event, 0); | 664 | event, 0); |
665 | break; | 665 | break; |
666 | } | 666 | } |