Skip to content

Commit

Permalink
ACPI: save device_type in acpi_device
Browse files Browse the repository at this point in the history
Most uses of the ACPI bus device_type (ACPI_BUS_TYPE_DEVICE,
ACPI_BUS_TYPE_POWER, etc) are during device initialization, but
we do need it later for notify handler installation, since that
is different for fixed hardware devices vs. namespace devices.

This patch saves the device_type in the acpi_device structure,
so we can check that rather than comparing against the _HID string.

Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
Bjorn Helgaas authored and lenb committed Sep 25, 2009
1 parent 66b7ed4 commit caaa6ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,7 @@ acpi_add_single_object(struct acpi_device **child,
return -ENOMEM;
}

device->device_type = type;
device->handle = handle;
device->parent = parent;
device->bus_ops = *ops; /* workround for not call .start */
Expand Down
3 changes: 2 additions & 1 deletion include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ struct acpi_device_wakeup {
/* Device */

struct acpi_device {
acpi_handle handle;
int device_type;
acpi_handle handle; /* no handle for fixed hardware */
struct acpi_device *parent;
struct list_head children;
struct list_head node;
Expand Down

0 comments on commit caaa6ef

Please sign in to comment.