From 9e5ed094c89e55fbf11d2e81d60be98eb12346c0 Mon Sep 17 00:00:00 2001 From: viresh kumar Date: Thu, 15 Mar 2012 10:40:38 +0100 Subject: 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 Signed-off-by: Russell King --- include/linux/amba/bus.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/amba/bus.h') 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 = { \ .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 -- cgit v1.2.3-55-g7522