Subject: [PATCH] [ACPI] Add some helpers to drivers/acpi/drivers/core.h - A debug macro - Conversion utilities for generic devices Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/core/core.h | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) applies-to: 44d3278c1313cfc7a695314e0feb76bcdc2a3843 b52130d8338205a90c7c4b18db74e884f99cd189 diff --git a/drivers/acpi/drivers/core/core.h b/drivers/acpi/drivers/core/core.h index c6b1b68..b7301a8 100644 --- a/drivers/acpi/drivers/core/core.h +++ b/drivers/acpi/drivers/core/core.h @@ -1,4 +1,24 @@ -#include +#include + +#define DEBUG + +#ifdef DEBUG +#define dbg(fmt, ...) printk(PREFIX "core: " fmt "\n", ## __VA_ARGS__) +#else +#define dbg(fmt, ...) +#endif + +static inline struct acpi_dev * to_acpi_dev(struct device * d) +{ + return container_of(d, struct acpi_dev, dev); +} + +static inline struct acpi_device_driver * to_acpi_driver(struct device_driver * drv) +{ + return container_of(drv, struct acpi_device_driver, d_drv); +} extern struct bus_type acpi_bus; + + --- 0.99.9.GIT