summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-21 00:21:50 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-21 00:21:50 +0100
commit95f8a082b9b1ead0c2859f2a7b1ac91ff63d8765 (patch)
treeb269991cc59baa25b277a873ba264bca8716f129 /drivers/acpi/scan.c
parentf3fd0c8a7fc1e4f3107a09a75e622781d3007b56 (diff)
downloadop-kernel-dev-95f8a082b9b1ead0c2859f2a7b1ac91ff63d8765.zip
op-kernel-dev-95f8a082b9b1ead0c2859f2a7b1ac91ff63d8765.tar.gz
ACPI / driver core: Introduce struct acpi_dev_node and related macros
To avoid adding an ACPI handle pointer to struct device on architectures that don't use ACPI, or generally when CONFIG_ACPI is not set, in which cases that pointer is useless, define struct acpi_dev_node that will contain the handle pointer if CONFIG_ACPI is set and will be empty otherwise and use it to represent the ACPI device node field in struct device. In addition to that define macros for reading and setting the ACPI handle of a device that don't generate code when CONFIG_ACPI is unset. Modify the ACPI subsystem to use those macros instead of referring to the given device's ACPI handle directly. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d842569..e92ca67 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -386,8 +386,8 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
{
struct acpi_device *adev;
- if (!ids || !dev->acpi_handle
- || ACPI_FAILURE(acpi_bus_get_device(dev->acpi_handle, &adev)))
+ if (!ids || !ACPI_HANDLE(dev)
+ || ACPI_FAILURE(acpi_bus_get_device(ACPI_HANDLE(dev), &adev)))
return NULL;
return __acpi_match_device(adev, ids);
OpenPOWER on IntegriCloud