diff options
author | viresh kumar <viresh.kumar@st.com> | 2012-03-15 05:40:38 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-16 19:32:35 -0400 |
commit | 9e5ed094c89e55fbf11d2e81d60be98eb12346c0 (patch) | |
tree | b77c63a452580643cdede36c3038d52995e54d8e /include/linux/amba/bus.h | |
parent | a64ae394eb7de5e39cf462c18edb202196c678fa (diff) |
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>
Diffstat (limited to 'include/linux/amba/bus.h')
-rw-r--r-- | include/linux/amba/bus.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index a9fab831caf8..7847e197730a 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -125,4 +125,13 @@ struct amba_device name##_device = { \ | |||
125 | .periphid = id, \ | 125 | .periphid = id, \ |
126 | } | 126 | } |
127 | 127 | ||
128 | /* | ||
129 | * module_amba_driver() - Helper macro for drivers that don't do anything | ||
130 | * special in module init/exit. This eliminates a lot of boilerplate. Each | ||
131 | * module may only use this macro once, and calling it replaces module_init() | ||
132 | * and module_exit() | ||
133 | */ | ||
134 | #define module_amba_driver(__amba_drv) \ | ||
135 | module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) | ||
136 | |||
128 | #endif | 137 | #endif |