ACPI: add device_driver and hepler functions
Add device_driver into acpi_driver for driver model.
Add helper functions 'to_acpi_device' and 'to_acpi_driver'
to get structure acpi_device/acpi_driver by device/device_driver.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index fdd1095..a09538e 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -136,6 +136,7 @@
atomic_t references;
char *ids; /* Supported Hardware IDs */
struct acpi_device_ops ops;
+ struct device_driver drv;
};
/*
@@ -301,6 +302,8 @@
};
#define acpi_driver_data(d) ((d)->driver_data)
+#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
+#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
/*
* Events