From: Bo Shen <voice.shen@atmel.com>
To: broonie@opensource.wolfsonmicro.com
Cc: alsa-devel@alsa-project.org, nicolas.ferre@atmel.com,
linux-sound@vger.kernel.org, Bo Shen <voice.shen@atmel.com>,
plagnioj@jcrosoft.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ASoC: atmel-ssc: use module_platform_driver macro
Date: Tue, 16 Oct 2012 03:56:59 +0000 [thread overview]
Message-ID: <1350359819-2461-2-git-send-email-voice.shen@atmel.com> (raw)
In-Reply-To: <1350359819-2461-1-git-send-email-voice.shen@atmel.com>
This patch removes some code duplication by using module_platform_driver
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
drivers/misc/atmel-ssc.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index 23dcb76..ac00f83 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -68,7 +68,7 @@ void ssc_free(struct ssc_device *ssc)
}
EXPORT_SYMBOL(ssc_free);
-static int __init ssc_probe(struct platform_device *pdev)
+static int ssc_probe(struct platform_device *pdev)
{
struct resource *regs;
struct ssc_device *ssc;
@@ -135,24 +135,14 @@ static int __devexit ssc_remove(struct platform_device *pdev)
}
static struct platform_driver ssc_driver = {
- .remove = __devexit_p(ssc_remove),
.driver = {
.name = "ssc",
.owner = THIS_MODULE,
},
+ .probe = ssc_probe,
+ .remove = __devexit_p(ssc_remove),
};
-
-static int __init ssc_init(void)
-{
- return platform_driver_probe(&ssc_driver, ssc_probe);
-}
-module_init(ssc_init);
-
-static void __exit ssc_exit(void)
-{
- platform_driver_unregister(&ssc_driver);
-}
-module_exit(ssc_exit);
+module_platform_driver(ssc_driver);
MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
MODULE_DESCRIPTION("SSC driver for Atmel AVR32 and AT91");
--
1.7.9.5
next prev parent reply other threads:[~2012-10-16 3:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 3:56 [PATCH 1/2] ASoC: atmel-ssc: use devm_xxx() managed function Bo Shen
2012-10-16 3:56 ` Bo Shen [this message]
2012-10-16 8:07 ` [PATCH 2/2] ASoC: atmel-ssc: use module_platform_driver macro Nicolas Ferre
2012-10-16 8:49 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-16 8:59 ` Bo Shen
2012-10-16 9:07 ` Russell King - ARM Linux
2012-10-16 9:32 ` Fabio Porcedda
2012-10-16 5:12 ` [PATCH 1/2] ASoC: atmel-ssc: use devm_xxx() managed function Mark Brown
2012-10-16 8:05 ` Nicolas Ferre
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=1350359819-2461-2-git-send-email-voice.shen@atmel.com \
--to=voice.shen@atmel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.com \
/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