ACPI: add device_driver and hepler functions
[pandora-kernel.git] / include / acpi / acpi_bus.h
index f338e40..a09538e 100644 (file)
@@ -136,6 +136,7 @@ struct acpi_driver {
        atomic_t references;
        char *ids;              /* Supported Hardware IDs */
        struct acpi_device_ops ops;
+       struct device_driver drv;
 };
 
 /*
@@ -301,6 +302,8 @@ struct acpi_device {
 };
 
 #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
@@ -357,7 +360,7 @@ struct device *acpi_get_physical_device(acpi_handle);
 /* helper */
 acpi_handle acpi_get_child(acpi_handle, acpi_integer);
 acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
-#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
+#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
 
 #endif /* CONFIG_ACPI */