提交 0d2cf8f5 编写于 作者: M Mika Westerberg 提交者: Len Brown

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: NMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 c46de226
...@@ -381,6 +381,19 @@ int acpi_match_device_ids(struct acpi_device *device, ...@@ -381,6 +381,19 @@ int acpi_match_device_ids(struct acpi_device *device,
int acpi_create_dir(struct acpi_device *); int acpi_create_dir(struct acpi_device *);
void acpi_remove_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *);
/**
* module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
* @__acpi_driver: acpi_driver struct
*
* Helper macro for ACPI drivers which do not do anything special in module
* init/exit. This eliminates a lot of boilerplate. Each module may only
* use this macro once, and calling it replaces module_init() and module_exit()
*/
#define module_acpi_driver(__acpi_driver) \
module_driver(__acpi_driver, acpi_bus_register_driver, \
acpi_bus_unregister_driver)
/* /*
* Bind physical devices with ACPI devices * Bind physical devices with ACPI devices
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册