diff options
author | Thierry Reding <treding@nvidia.com> | 2015-12-02 16:31:55 (GMT) |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-12-10 22:50:53 (GMT) |
commit | bab7f5a4019b6ca410acdf8730b924b989049423 (patch) | |
tree | 48fa4f9802e128141631298f0d033aa74442a679 /drivers | |
parent | 9b0ee474cfdbce235f63e179d018e28673163075 (diff) | |
download | linux-bab7f5a4019b6ca410acdf8730b924b989049423.tar.xz |
pinctrl: at91: Use platform_register/unregister_drivers()
These new helpers simplify implementing multi-driver modules and
properly handle failure to register one driver by unregistering all
previously registered drivers.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 0d2fc0c..47b625b 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1828,20 +1828,20 @@ static struct platform_driver at91_pinctrl_driver = { .remove = at91_pinctrl_remove, }; +static struct platform_driver * const drivers[] = { + &at91_gpio_driver, + &at91_pinctrl_driver, +}; + static int __init at91_pinctrl_init(void) { - int ret; - - ret = platform_driver_register(&at91_gpio_driver); - if (ret) - return ret; - return platform_driver_register(&at91_pinctrl_driver); + return platform_register_drivers(drivers, ARRAY_SIZE(drivers)); } arch_initcall(at91_pinctrl_init); static void __exit at91_pinctrl_exit(void) { - platform_driver_unregister(&at91_pinctrl_driver); + platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); } module_exit(at91_pinctrl_exit); |