mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH 5/5] Introduce coredevice_platform_driver() macro and use it for GPIO drivers
Date: Sat, 20 Apr 2013 08:18:52 +0400	[thread overview]
Message-ID: <1366431532-29121-6-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1366431532-29121-1-git-send-email-shc_work@mail.ru>


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/gpio/gpio-bcm2835.c  | 7 +------
 drivers/gpio/gpio-clps711x.c | 7 +------
 drivers/gpio/gpio-generic.c  | 8 +-------
 drivers/gpio/gpio-imx.c      | 7 +------
 drivers/gpio/gpio-stmpe.c    | 7 +------
 include/driver.h             | 6 ++++--
 6 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/drivers/gpio/gpio-bcm2835.c b/drivers/gpio/gpio-bcm2835.c
index cec15c9..9df8a1a 100644
--- a/drivers/gpio/gpio-bcm2835.c
+++ b/drivers/gpio/gpio-bcm2835.c
@@ -150,9 +150,4 @@ static struct driver_d bcm2835_gpio_driver = {
 	.probe = bcm2835_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(bcm2835_gpio_dt_ids),
 };
-
-static int bcm2835_gpio_add(void)
-{
-	return platform_driver_register(&bcm2835_gpio_driver);
-}
-coredevice_initcall(bcm2835_gpio_add);
+coredevice_platform_driver(bcm2835_gpio_driver);
diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
index feead51..778a8d1 100644
--- a/drivers/gpio/gpio-clps711x.c
+++ b/drivers/gpio/gpio-clps711x.c
@@ -62,9 +62,4 @@ static struct driver_d clps711x_gpio_driver = {
 	.name	= "clps711x-gpio",
 	.probe	= clps711x_gpio_probe,
 };
-
-static __init int clps711x_gpio_register(void)
-{
-	return platform_driver_register(&clps711x_gpio_driver);
-}
-coredevice_initcall(clps711x_gpio_register);
+coredevice_platform_driver(clps711x_gpio_driver);
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index a2fc400..0f49712 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -414,13 +414,7 @@ static struct driver_d bgpio_driver = {
 	.probe		= bgpio_dev_probe,
 	.remove		= bgpio_dev_remove,
 };
-
-static int bgpio_register(void)
-{
-	return platform_driver_register(&bgpio_driver);
-}
-coredevice_initcall(bgpio_register);
-
+coredevice_platform_driver(bgpio_driver);
 #endif
 
 MODULE_DESCRIPTION("Driver for basic memory-mapped GPIO controllers");
diff --git a/drivers/gpio/gpio-imx.c b/drivers/gpio/gpio-imx.c
index f56346b..17261e4 100644
--- a/drivers/gpio/gpio-imx.c
+++ b/drivers/gpio/gpio-imx.c
@@ -124,9 +124,4 @@ static struct driver_d imx_gpio_driver = {
 	.of_compatible	= DRV_OF_COMPAT(imx_gpio_dt_ids),
 	.id_table	= imx_gpio_ids,
 };
-
-static int imx_gpio_add(void)
-{
-	return platform_driver_register(&imx_gpio_driver);
-}
-coredevice_initcall(imx_gpio_add);
+coredevice_platform_driver(imx_gpio_driver);
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index d7e6404..d0319a6 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -153,9 +153,4 @@ static struct driver_d stmpe_gpio_driver = {
 	.name = "stmpe-gpio",
 	.probe = stmpe_gpio_probe,
 };
-
-static int stmpe_gpio_add(void)
-{
-	return platform_driver_register(&stmpe_gpio_driver);
-}
-coredevice_initcall(stmpe_gpio_add);
+coredevice_platform_driver(stmpe_gpio_driver);
diff --git a/include/driver.h b/include/driver.h
index 716f792..5e8561f 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -406,10 +406,12 @@ int platform_driver_register(struct driver_d *drv);
 	}						\
 	level##_initcall(drv##_register)
 
-#define device_platform_driver(drv)	\
-	register_driver_macro(device,platform,drv)
 #define console_platform_driver(drv)	\
 	register_driver_macro(console,platform,drv)
+#define coredevice_platform_driver(drv)	\
+	register_driver_macro(coredevice,platform,drv)
+#define device_platform_driver(drv)	\
+	register_driver_macro(device,platform,drv)
 
 int platform_device_register(struct device_d *new_device);
 
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-04-20  4:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-20  4:18 [PATCH 1/5] GPIO: Rename "drivers/gpio.c" to "drivers/gpiolib.c" Alexander Shiyan
2013-04-20  4:18 ` [PATCH] ubimkvol: Typo fix Alexander Shiyan
2013-04-20  4:18 ` [PATCH 2/5] ARM: i.MX: Move GPIO driver to drivers/gpio Alexander Shiyan
2013-04-20  4:18 ` [PATCH 3/5] GPIO: i.MX: Rewrite driver for using generic GPIO code Alexander Shiyan
2013-04-22  6:46   ` Sascha Hauer
2013-04-22  6:59     ` Re[2]: " Alexander Shiyan
2013-04-22  7:21       ` Sascha Hauer
2013-04-22  9:23         ` Re[2]: " Alexander Shiyan
2013-04-20  4:18 ` [PATCH 4/5] GPIO: i.MX: Cleanup driver code Alexander Shiyan
2013-04-20 17:04   ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-22 16:58   ` Sascha Hauer
2013-04-20  4:18 ` Alexander Shiyan [this message]
2013-04-22 16:59 ` [PATCH 1/5] GPIO: Rename "drivers/gpio.c" to "drivers/gpiolib.c" Sascha Hauer

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=1366431532-29121-6-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.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