diff options
author | Zhang Rui <rui.zhang@intel.com> | 2007-01-04 02:03:18 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-01-05 23:43:00 -0500 |
commit | bb0958544f3c7c016b2a3025ab3694363e403aa1 (patch) | |
tree | bd7ea8032861f5b4097ab10334ad5c80dfa397ad /drivers/acpi/scan.c | |
parent | 2786f6e388e9dfe9e7b1c3c6bd7fcfba9cfb9831 (diff) |
ACPI: use more understandable bus_id for ACPI devices
Some of the ACPI devices use the internal fake hids
which are exposed to userspace as devces' bus_id after sysfs conversion.
To make it more friendly, we convert them to more understandable strings.
For those devices w/o PNPids, we use "device:instance_no" as the bus_id
instead of "PNPIDNON:instance_no".
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 30a39baeac51..4139e65d0ff5 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -26,7 +26,7 @@ DEFINE_SPINLOCK(acpi_device_lock); | |||
26 | LIST_HEAD(acpi_wakeup_device_list); | 26 | LIST_HEAD(acpi_wakeup_device_list); |
27 | 27 | ||
28 | struct acpi_device_bus_id{ | 28 | struct acpi_device_bus_id{ |
29 | char bus_id[9]; | 29 | char bus_id[15]; |
30 | unsigned int instance_no; | 30 | unsigned int instance_no; |
31 | struct list_head node; | 31 | struct list_head node; |
32 | }; | 32 | }; |
@@ -342,7 +342,7 @@ static int acpi_device_register(struct acpi_device *device, | |||
342 | * If failed, create one and link it into acpi_bus_id_list | 342 | * If failed, create one and link it into acpi_bus_id_list |
343 | */ | 343 | */ |
344 | list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { | 344 | list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { |
345 | if(!strcmp(acpi_device_bus_id->bus_id, device->flags.hardware_id? device->pnp.hardware_id : "PNPIDNON")) { | 345 | if(!strcmp(acpi_device_bus_id->bus_id, device->flags.hardware_id? device->pnp.hardware_id : "device")) { |
346 | acpi_device_bus_id->instance_no ++; | 346 | acpi_device_bus_id->instance_no ++; |
347 | found = 1; | 347 | found = 1; |
348 | kfree(new_bus_id); | 348 | kfree(new_bus_id); |
@@ -351,7 +351,7 @@ static int acpi_device_register(struct acpi_device *device, | |||
351 | } | 351 | } |
352 | if(!found) { | 352 | if(!found) { |
353 | acpi_device_bus_id = new_bus_id; | 353 | acpi_device_bus_id = new_bus_id; |
354 | strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? device->pnp.hardware_id : "PNPIDNON"); | 354 | strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? device->pnp.hardware_id : "device"); |
355 | acpi_device_bus_id->instance_no = 0; | 355 | acpi_device_bus_id->instance_no = 0; |
356 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); | 356 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); |
357 | } | 357 | } |