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:
viresh kumar 2012-03-15 10:40:38 +01:00 committed by Russell King
parent a64ae394eb
commit 9e5ed094c8
9 changed files with 17 additions and 94 deletions

View file

@ -185,18 +185,7 @@ static struct amba_driver pl030_driver = {
.id_table = pl030_ids,
};
static int __init pl030_init(void)
{
return amba_driver_register(&pl030_driver);
}
static void __exit pl030_exit(void)
{
amba_driver_unregister(&pl030_driver);
}
module_init(pl030_init);
module_exit(pl030_exit);
module_amba_driver(pl030_driver);
MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
MODULE_DESCRIPTION("ARM AMBA PL030 RTC Driver");