Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166384
b: refs/heads/master
c: 859ac9a
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Sep 25, 2009
1 parent d6cffc8 commit 1371f94
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: adc08e2035f1859d4b129f42b2c2305ef090d226
refs/heads/master: 859ac9a4be0c753cece0e30a2e4a65fd2cdcaeee
20 changes: 13 additions & 7 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ extern struct acpi_device *acpi_root;
#define ACPI_BUS_HID "LNXSYBUS"
#define ACPI_BUS_DEVICE_NAME "System Bus"

#define ACPI_IS_ROOT_DEVICE(device) (!(device)->parent)

static LIST_HEAD(acpi_device_list);
static LIST_HEAD(acpi_bus_id_list);
DEFINE_MUTEX(acpi_device_lock);
Expand Down Expand Up @@ -955,10 +957,12 @@ static void acpi_device_get_busid(struct acpi_device *device)
* The device's Bus ID is simply the object name.
* TBD: Shouldn't this value be unique (within the ACPI namespace)?
*/
switch (device->device_type) {
case ACPI_BUS_TYPE_SYSTEM:
if (ACPI_IS_ROOT_DEVICE(device)) {
strcpy(device->pnp.bus_id, "ACPI");
break;
return;
}

switch (device->device_type) {
case ACPI_BUS_TYPE_POWER_BUTTON:
strcpy(device->pnp.bus_id, "PWRF");
break;
Expand Down Expand Up @@ -1093,6 +1097,11 @@ static void acpi_device_set_id(struct acpi_device *device)

switch (device->device_type) {
case ACPI_BUS_TYPE_DEVICE:
if (ACPI_IS_ROOT_DEVICE(device)) {
hid = ACPI_SYSTEM_HID;
break;
}

status = acpi_get_object_info(device->handle, &info);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "%s: Error reading device info\n", __func__);
Expand Down Expand Up @@ -1129,9 +1138,6 @@ static void acpi_device_set_id(struct acpi_device *device)
case ACPI_BUS_TYPE_PROCESSOR:
hid = ACPI_PROCESSOR_OBJECT_HID;
break;
case ACPI_BUS_TYPE_SYSTEM:
hid = ACPI_SYSTEM_HID;
break;
case ACPI_BUS_TYPE_THERMAL:
hid = ACPI_THERMAL_HID;
break;
Expand Down Expand Up @@ -1643,7 +1649,7 @@ int __init acpi_scan_init(void)
* Create the root device in the bus's device tree
*/
result = acpi_add_single_object(&acpi_root, ACPI_ROOT_OBJECT,
ACPI_BUS_TYPE_SYSTEM, &ops);
ACPI_BUS_TYPE_DEVICE, &ops);
if (result)
goto Done;

Expand Down
1 change: 0 additions & 1 deletion trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ enum acpi_bus_device_type {
ACPI_BUS_TYPE_POWER,
ACPI_BUS_TYPE_PROCESSOR,
ACPI_BUS_TYPE_THERMAL,
ACPI_BUS_TYPE_SYSTEM,
ACPI_BUS_TYPE_POWER_BUTTON,
ACPI_BUS_TYPE_SLEEP_BUTTON,
ACPI_BUS_DEVICE_TYPE_COUNT
Expand Down

0 comments on commit 1371f94

Please sign in to comment.