From: Thierry Reding <thierry.reding@avionic-design.de>
To: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Mike Turquette <mturquette@linaro.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] unicore32: pwm: Use module_platform_driver()
Date: Sun, 2 Sep 2012 12:21:09 +0200 [thread overview]
Message-ID: <1346581273-7041-3-git-send-email-thierry.reding@avionic-design.de> (raw)
In-Reply-To: <1346581273-7041-1-git-send-email-thierry.reding@avionic-design.de>
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>
---
arch/unicore32/kernel/pwm.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/arch/unicore32/kernel/pwm.c b/arch/unicore32/kernel/pwm.c
index 410b786..22a7098 100644
--- a/arch/unicore32/kernel/pwm.c
+++ b/arch/unicore32/kernel/pwm.c
@@ -258,25 +258,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");
--
1.7.12
next prev parent reply other threads:[~2012-09-02 10:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-02 10:21 [PATCH 0/6] unicore32: Move PWM driver to PWM framework Thierry Reding
2012-09-02 10:21 ` [PATCH 1/6] unicore32: pwm: Properly remap memory-mapped registers Thierry Reding
2012-09-06 8:38 ` guanxuetao
2012-09-07 12:50 ` Thierry Reding
2012-09-02 10:21 ` Thierry Reding [this message]
2012-09-02 10:21 ` [PATCH 3/6] unicore32: pwm: Remove unnecessary indirection Thierry Reding
2012-09-02 10:21 ` [PATCH 4/6] unicore32: Add common clock support Thierry Reding
2012-09-06 8:42 ` guanxuetao
2012-09-07 12:53 ` Thierry Reding
2012-09-08 1:22 ` Mike Turquette
2012-09-02 10:21 ` [PATCH 5/6] unicore32: pwm: Use managed resource allocations Thierry Reding
2012-09-02 10:21 ` [PATCH 6/6] pwm: Move PUV3 PWM driver to PWM framework Thierry Reding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346581273-7041-3-git-send-email-thierry.reding@avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=gxt@mprc.pku.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox