ARM: 7362/1: AMBA: Add module_amba_driver() helper macro for amba_driver
For simple modules that contain a single amba_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_amba_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
a64ae394eb
commit
9e5ed094c8
9 changed files with 17 additions and 94 deletions
|
@ -125,4 +125,13 @@ struct amba_device name##_device = { \
|
|||
.periphid = id, \
|
||||
}
|
||||
|
||||
/*
|
||||
* module_amba_driver() - Helper macro for drivers that don't 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_amba_driver(__amba_drv) \
|
||||
module_driver(__amba_drv, amba_driver_register, amba_driver_unregister)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue