diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2012-08-30 13:43:14 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2012-10-05 20:56:40 +0200 |
commit | dde9959b8d5b791a3e06e3c44f2d9ba0ec5143f0 (patch) | |
tree | f5b008c23cf365ce10a323090b5b73a09803e4b1 | |
parent | d1b6886502160eb771aefe21c1f891597138ddfe (diff) |
unicore32: pwm: Use module_platform_driver()
Some of the boilerplate code can be eliminated by using this macro. The
driver was previously registered with an arch_initcall(), so technically
this is no longer the same, but when the driver is moved to the PWM
framework, deferred probing will take care of any driver probe ordering
issues.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Qin Rui <qinrui@mprc.pku.edu.cn>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
-rw-r--r-- | arch/unicore32/kernel/pwm.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/arch/unicore32/kernel/pwm.c b/arch/unicore32/kernel/pwm.c index 885bbcdc253..012c54a8019 100644 --- a/arch/unicore32/kernel/pwm.c +++ b/arch/unicore32/kernel/pwm.c @@ -254,25 +254,6 @@ static struct platform_driver puv3_pwm_driver = { .probe = puv3_pwm_probe, .remove = __devexit_p(pwm_remove), }; - -static int __init pwm_init(void) -{ - int ret = 0; - - ret = platform_driver_register(&puv3_pwm_driver); - if (ret) { - printk(KERN_ERR "failed to register puv3_pwm_driver\n"); - return ret; - } - - return ret; -} -arch_initcall(pwm_init); - -static void __exit pwm_exit(void) -{ - platform_driver_unregister(&puv3_pwm_driver); -} -module_exit(pwm_exit); +module_platform_driver(puv3_pwm_driver); MODULE_LICENSE("GPL v2"); |