mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 03/18] drivers: gpio: treewide: [cosmetic] use register_driver_macros
Date: Mon, 28 Sep 2020 17:50:26 +0200	[thread overview]
Message-ID: <20200928155041.32649-4-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20200928155041.32649-1-m.felsch@pengutronix.de>

Use the existing macros to register the drivers. No functional changes
except for the gpio-mxs and gpio-imx driver. Now they do not ignore the
return values anymore.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/gpio/gpio-ath79.c          | 7 +------
 drivers/gpio/gpio-davinci.c        | 7 +------
 drivers/gpio/gpio-digic.c          | 7 +------
 drivers/gpio/gpio-dw.c             | 7 +------
 drivers/gpio/gpio-generic.c        | 7 +------
 drivers/gpio/gpio-imx.c            | 8 +-------
 drivers/gpio/gpio-jz4740.c         | 7 +------
 drivers/gpio/gpio-malta-fpga-i2c.c | 7 +------
 drivers/gpio/gpio-mpc8xxx.c        | 7 +------
 drivers/gpio/gpio-mxs.c            | 8 +-------
 drivers/gpio/gpio-omap.c           | 7 +------
 drivers/gpio/gpio-stmpe.c          | 7 +------
 drivers/gpio/gpio-tegra.c          | 7 +------
 drivers/gpio/gpio-vf610.c          | 7 +------
 14 files changed, 14 insertions(+), 86 deletions(-)

diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index d08d743b54..a33d7d290e 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -150,9 +150,4 @@ static struct driver_d ath79_gpio_driver = {
 	.probe = ath79_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(ath79_gpio_of_match),
 };
-
-static int ath79_gpio_init(void)
-{
-	return platform_driver_register(&ath79_gpio_driver);
-}
-coredevice_initcall(ath79_gpio_init);
+coredevice_platform_driver(ath79_gpio_driver);
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 7c060a09b1..bffe385860 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -205,9 +205,4 @@ static struct driver_d davinci_gpio_driver = {
 	.probe		= davinci_gpio_probe,
 	.of_compatible	= DRV_OF_COMPAT(davinci_gpio_ids),
 };
-
-static int davinci_gpio_drv_reg(void)
-{
-	return platform_driver_register(&davinci_gpio_driver);
-}
-coredevice_initcall(davinci_gpio_drv_reg);
+coredevice_platform_driver(davinci_gpio_driver);
diff --git a/drivers/gpio/gpio-digic.c b/drivers/gpio/gpio-digic.c
index f7a68d09fc..4cf45397ce 100644
--- a/drivers/gpio/gpio-digic.c
+++ b/drivers/gpio/gpio-digic.c
@@ -175,9 +175,4 @@ static struct driver_d digic_gpio_driver = {
 	.probe = digic_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(digic_gpio_dt_ids),
 };
-
-static int digic_gpio_init(void)
-{
-	return platform_driver_register(&digic_gpio_driver);
-}
-coredevice_initcall(digic_gpio_init);
+coredevice_platform_driver(digic_gpio_driver);
diff --git a/drivers/gpio/gpio-dw.c b/drivers/gpio/gpio-dw.c
index b81e6a75c5..dd7efd2942 100644
--- a/drivers/gpio/gpio-dw.c
+++ b/drivers/gpio/gpio-dw.c
@@ -194,9 +194,4 @@ static struct driver_d dwgpio_driver = {
 	.probe = dw_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(dwgpio_match),
 };
-
-static int __init dwgpio_init(void)
-{
-	return platform_driver_register(&dwgpio_driver);
-}
-postcore_initcall(dwgpio_init);
+postcore_platform_driver(dwgpio_driver);
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index 2e0dad9974..ad4e6859cb 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -423,12 +423,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
 
diff --git a/drivers/gpio/gpio-imx.c b/drivers/gpio/gpio-imx.c
index 2827e11e73..6f913377f0 100644
--- a/drivers/gpio/gpio-imx.c
+++ b/drivers/gpio/gpio-imx.c
@@ -216,10 +216,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)
-{
-	platform_driver_register(&imx_gpio_driver);
-	return 0;
-}
-postcore_initcall(imx_gpio_add);
+postcore_platform_driver(imx_gpio_driver);
diff --git a/drivers/gpio/gpio-jz4740.c b/drivers/gpio/gpio-jz4740.c
index 87e0716b06..bd126c83c1 100644
--- a/drivers/gpio/gpio-jz4740.c
+++ b/drivers/gpio/gpio-jz4740.c
@@ -135,9 +135,4 @@ static struct driver_d jz4740_gpio_driver = {
 	.probe = jz4740_gpio_probe,
 	.of_compatible	= DRV_OF_COMPAT(jz4740_gpio_dt_ids),
 };
-
-static int jz4740_gpio_init(void)
-{
-	return platform_driver_register(&jz4740_gpio_driver);
-}
-coredevice_initcall(jz4740_gpio_init);
+coredevice_platform_driver(jz4740_gpio_driver);
diff --git a/drivers/gpio/gpio-malta-fpga-i2c.c b/drivers/gpio/gpio-malta-fpga-i2c.c
index 9142248571..7afa40460f 100644
--- a/drivers/gpio/gpio-malta-fpga-i2c.c
+++ b/drivers/gpio/gpio-malta-fpga-i2c.c
@@ -179,9 +179,4 @@ static struct driver_d malta_i2c_gpio_driver = {
 	.probe = malta_i2c_gpio_probe,
 	.of_compatible	= DRV_OF_COMPAT(malta_i2c_gpio_dt_ids),
 };
-
-static int malta_i2c_gpio_driver_init(void)
-{
-	return platform_driver_register(&malta_i2c_gpio_driver);
-}
-coredevice_initcall(malta_i2c_gpio_driver_init);
+coredevice_platform_driver(malta_i2c_gpio_driver);
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 979f92ad30..a5a383bfd6 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -114,9 +114,4 @@ static struct driver_d mpc8xxx_driver = {
 	.probe		= mpc8xxx_probe,
 	.of_compatible  = DRV_OF_COMPAT(mpc8xxx_gpio_ids),
 };
-
-static int __init mpc8xxx_init(void)
-{
-	return platform_driver_register(&mpc8xxx_driver);
-}
-postcore_initcall(mpc8xxx_init);
+postcore_platform_driver(mpc8xxx_driver);
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index ef78873ad2..43a1379077 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -177,10 +177,4 @@ static struct driver_d mxs_gpio_driver = {
 	.of_compatible = DRV_OF_COMPAT(mxs_gpio_dt_ids),
 	.id_table = mxs_gpio_ids,
 };
-
-static int mxs_gpio_add(void)
-{
-	platform_driver_register(&mxs_gpio_driver);
-	return 0;
-}
-postcore_initcall(mxs_gpio_add);
+postcore_platform_driver(mxs_gpio_driver);
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index b00766a6aa..9075f68926 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -191,9 +191,4 @@ static struct driver_d omap_gpio_driver = {
 	.probe = omap_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(omap_gpio_dt_ids),
 };
-
-static int omap_gpio_add(void)
-{
-	return platform_driver_register(&omap_gpio_driver);
-}
-coredevice_initcall(omap_gpio_add);
+coredevice_platform_driver(omap_gpio_driver);
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index d7e64045b4..d0319a6dc8 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/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 56808b57e4..331402607c 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -200,9 +200,4 @@ static struct driver_d tegra_gpio_driver = {
 	.of_compatible	= DRV_OF_COMPAT(tegra_gpio_dt_ids),
 	.probe		= tegra_gpio_probe,
 };
-
-static int __init tegra_gpio_init(void)
-{
-	return platform_driver_register(&tegra_gpio_driver);
-}
-coredevice_initcall(tegra_gpio_init);
+coredevice_platform_driver(tegra_gpio_driver);
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index ab35310fbe..55df0a591c 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -155,9 +155,4 @@ static struct driver_d vf610_gpio_driver = {
 	.probe  = vf610_gpio_probe,
 	.of_compatible = DRV_OF_COMPAT(vf610_gpio_dt_ids),
 };
-
-static int __init gpio_vf610_init(void)
-{
-	return platform_driver_register(&vf610_gpio_driver);
-}
-postcore_initcall(gpio_vf610_init);
+postcore_platform_driver(vf610_gpio_driver);
-- 
2.20.1


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

  parent reply	other threads:[~2020-09-28 15:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 15:50 [PATCH 00/18] Barebox Deep-Probe Marco Felsch
2020-09-28 15:50 ` [PATCH 01/18] video: ssd1307fb: fix VBAT supply id Marco Felsch
2020-09-28 15:58   ` Ahmad Fatoum
2020-09-28 15:50 ` [PATCH 02/18] ARM: boards: mx6-sabrelite: [cosmetic] make use of IMX_GPIO_NR Marco Felsch
2020-09-28 16:00   ` Ahmad Fatoum
2020-09-28 15:50 ` Marco Felsch [this message]
2020-09-28 16:04   ` [PATCH 03/18] drivers: gpio: treewide: [cosmetic] use register_driver_macros Ahmad Fatoum
2020-09-29  8:20   ` Sascha Hauer
2020-09-28 15:50 ` [PATCH 04/18] ARM: mx6-sabrelite: remove obsolete sabrelite_mem_init() Marco Felsch
2020-09-28 16:07   ` Ahmad Fatoum
2020-09-28 15:50 ` [PATCH 05/18] spi: core: don't ignore register_device failures Marco Felsch
2020-09-28 15:50 ` [PATCH 06/18] regulator: improve of_regulator_register error handling Marco Felsch
2020-09-28 15:50 ` [PATCH 07/18] regulator: test of_regulator_register input before accessing it Marco Felsch
2020-09-28 16:11   ` Ahmad Fatoum
2020-09-28 15:50 ` [PATCH 08/18] regulator: stpmic1: fix registering missed regulators Marco Felsch
2020-09-28 15:50 ` [PATCH 09/18] regulator: add device reference to regulator_dev Marco Felsch
2020-09-28 15:50 ` [PATCH 10/18] regulator: treewide: drop local device_d reference Marco Felsch
2020-09-28 15:50 ` [PATCH 11/18] of: platform: fix of_amba_device_create stub return value Marco Felsch
2020-09-28 15:50 ` [PATCH 12/18] of: base: move memory init from DT to initcall Marco Felsch
2020-09-28 15:50 ` [PATCH 13/18] of: base: move clock init from of_probe() to barebox_register_of() Marco Felsch
2020-09-28 15:50 ` [PATCH 14/18] initcall: add of_populate_initcall Marco Felsch
2020-09-28 15:50 ` [PATCH 15/18] common: add initial barebox deep-probe support Marco Felsch
2020-09-28 16:53   ` Ahmad Fatoum
2020-09-29 15:55     ` Marco Felsch
2020-09-28 15:50 ` [PATCH 16/18] ARM: i.MX: esdctl: add " Marco Felsch
2020-09-28 15:50 ` [PATCH 17/18] ARM: stm32mp: ddrctrl: " Marco Felsch
2020-09-28 15:50 ` [PATCH 18/18] ARM: boards: mx6-sabrelite: " Marco Felsch
2020-09-28 16:58   ` Ahmad Fatoum
2020-09-29  8:30 ` [PATCH 00/18] Barebox Deep-Probe 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=20200928155041.32649-4-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --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