diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2012-09-07 03:31:38 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-09-21 13:38:12 -0400 |
commit | 0d2cf8f5aab358c897902ebad40fa4edd1b4556e (patch) | |
tree | 19e6d891bcbe3e42790d4b2df51c8fcd81aab708 /include/acpi | |
parent | c46de2263f42fb4bbde411b9126f471e9343cb22 (diff) |
ACPI: introduce module_acpi_driver() helper macro
Add a helper macro module_acpi_driver() which reduces the boilerplate code
for ACPI drivers. This is similar what is done for other busses (PCI, SPI,
I2C etc).
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acpi_bus.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index bde976ee068d..bddd90975e4e 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -381,6 +381,19 @@ int acpi_match_device_ids(struct acpi_device *device, | |||
381 | int acpi_create_dir(struct acpi_device *); | 381 | int acpi_create_dir(struct acpi_device *); |
382 | void acpi_remove_dir(struct acpi_device *); | 382 | void acpi_remove_dir(struct acpi_device *); |
383 | 383 | ||
384 | |||
385 | /** | ||
386 | * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver | ||
387 | * @__acpi_driver: acpi_driver struct | ||
388 | * | ||
389 | * Helper macro for ACPI drivers which do not do anything special in module | ||
390 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
391 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
392 | */ | ||
393 | #define module_acpi_driver(__acpi_driver) \ | ||
394 | module_driver(__acpi_driver, acpi_bus_register_driver, \ | ||
395 | acpi_bus_unregister_driver) | ||
396 | |||
384 | /* | 397 | /* |
385 | * Bind physical devices with ACPI devices | 398 | * Bind physical devices with ACPI devices |
386 | */ | 399 | */ |