On Fri, 31 Jul 2009, Bjorn Helgaas wrote: > We can identify the root of the ACPI device tree by the fact that it > has no parent. This is simpler than passing around ACPI_BUS_TYPE_SYSTEM > and will help remove special treatment of the device tree root. > > Currently, we add the root by hand with ACPI_BUS_TYPE_SYSTEM. If we > traverse the tree treating the root as just another device and use > acpi_get_type(), the root shows up as ACPI_TYPE_DEVICE. > > Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx> > --- > drivers/acpi/scan.c | 18 +++++++++++------- > include/acpi/acpi_bus.h | 1 - > 2 files changed, 11 insertions(+), 8 deletions(-) > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > index b97b2ad..c0736f6 100644 > --- a/drivers/acpi/scan.c > +++ b/drivers/acpi/scan.c > @@ -950,10 +950,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 (!device->parent) { it is just a style thing, but i probably would use a macro for this, such as ACPI_IS_ROOT(device) to make the code read easier to the un-initiated. thanks, -Len Brown, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html