2016-03-27 15:45:57

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 0/9] gpio: batch #1: remove modular usage from non-modular drivers

For GPIO, I've divided up the the audit of modular usage in non-modular
drivers into three categories to ease review and limit the batch size.
The breakdown of the three groups is as follows:

1) just replacement of modular macros with their non-modular equivalents
that CPP would have inserted anyway ; this means runtime equivalence
and actually also binary equivalence.

[This lot represents #1, which are essentially the "free" ones that have
essentially zero impact beyond the original desired cleanup goal itself.]

2) as per #1 but also with the removal of unused/orphaned __exit functions
that could never be called/exercised. This also maintains runtime
equivalence, but since the unused __exit function is gone, there is a
reduction in the object file size and hence not binary equivalence, eg:
before: -rw-rw-r-- 1 8828 drivers/gpio/gpio-rc5t583.o
after: -rw-rw-r-- 1 7396 drivers/gpio/gpio-rc5t583.o

3) as per #2 but also with the removal of a ".remove" function that is
hooked into the driver struct. This ".remove" function would of
course not be called from the __exit function since that is never run.
However in theory, someone could have triggered it via sysfs unbind,
even though there isn't a sensible use case for doing so. So to cover
that possibility, we've also disabled sysfs unbind in these drivers.

I will send #2 once this #1 is finalized/merged and #3 once #2 is merged.

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

(1) it is easy to accidentally write unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be
modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn
includes nearly everything else, thus adding to CPP overhead.
(4) it gets copied/replicated into other code and spreads like weeds.

Build tested for arm and arm64 on 4.6-rc1 to ensure no silly typos exist.

Paul.
---

Cc: Alexandre Courbot <[email protected]>
Cc: Baruch Siach <[email protected]>
Cc: [email protected]
Cc: Feng Kan <[email protected]>
Cc: Jonas Jensen <[email protected]>
Cc: Jun Nie <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Ray Jui <[email protected]>
Cc: Wu Guoxing <[email protected]>
Cc: [email protected]

Paul Gortmaker (9):
drivers/gpio: make gpio-bcm-kona.c explicitly non-modular
drivers/gpio: make gpio-mb86s7x.c driver explicitly non-modular
drivers/gpio: make gpio-mc9s08dz60.c explicitly non-modular
drivers/gpio: make gpio-moxart.c explicitly non-modular
drivers/gpio: make gpio-mvebu.c explicitly non-modular
drivers/gpio: make gpio-pl061.c explicitly non-modular
drivers/gpio: make gpio-sta2x11.c explicitly non-modular
drivers/gpio: make gpio-xgene.c explicitly non-modular
drivers/gpio: make gpio-zx.c explicitly non-modular

drivers/gpio/gpio-bcm-kona.c | 14 +++++---------
drivers/gpio/gpio-mb86s7x.c | 8 +-------
drivers/gpio/gpio-mc9s08dz60.c | 12 ++----------
drivers/gpio/gpio-moxart.c | 7 +------
drivers/gpio/gpio-mvebu.c | 5 ++---
drivers/gpio/gpio-pl061.c | 12 ++++--------
drivers/gpio/gpio-sta2x11.c | 8 ++------
drivers/gpio/gpio-xgene.c | 9 +--------
drivers/gpio/gpio-zx.c | 14 ++++++--------
9 files changed, 24 insertions(+), 65 deletions(-)

--
2.6.1


2016-03-27 15:45:15

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 1/9] drivers/gpio: make gpio-bcm-kona.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

config GPIO_BCM_KONA
bool "Broadcom Kona GPIO"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Ray Jui <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-bcm-kona.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 2fd38d598f3d..9aabc48ff5de 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -1,4 +1,7 @@
/*
+ * Broadcom Kona GPIO Driver
+ *
+ * Author: Broadcom Corporation <[email protected]>
* Copyright (C) 2012-2014 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +20,7 @@
#include <linux/gpio.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/irqdomain.h>
#include <linux/irqchip/chained_irq.h>

@@ -502,8 +505,6 @@ static struct of_device_id const bcm_kona_gpio_of_match[] = {
{}
};

-MODULE_DEVICE_TABLE(of, bcm_kona_gpio_of_match);
-
/*
* This lock class tells lockdep that GPIO irqs are in a different
* category than their parents, so it won't report false recursion.
@@ -659,9 +660,4 @@ static struct platform_driver bcm_kona_gpio_driver = {
},
.probe = bcm_kona_gpio_probe,
};
-
-module_platform_driver(bcm_kona_gpio_driver);
-
-MODULE_AUTHOR("Broadcom Corporation <[email protected]>");
-MODULE_DESCRIPTION("Broadcom Kona GPIO Driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(bcm_kona_gpio_driver);
--
2.6.1

2016-03-27 15:45:23

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 5/9] drivers/gpio: make gpio-mvebu.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MVEBU
drivers/gpio/Kconfig: def_bool y

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-mvebu.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 11c6582ef0a6..cd5dc27320a2 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -34,7 +34,7 @@
*/

#include <linux/err.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/irq.h>
#include <linux/slab.h>
@@ -557,7 +557,6 @@ static const struct of_device_id mvebu_gpio_of_match[] = {
/* sentinel */
},
};
-MODULE_DEVICE_TABLE(of, mvebu_gpio_of_match);

static int mvebu_gpio_suspend(struct platform_device *pdev, pm_message_t state)
{
@@ -838,4 +837,4 @@ static struct platform_driver mvebu_gpio_driver = {
.suspend = mvebu_gpio_suspend,
.resume = mvebu_gpio_resume,
};
-module_platform_driver(mvebu_gpio_driver);
+builtin_platform_driver(mvebu_gpio_driver);
--
2.6.1

2016-03-27 15:45:28

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 8/9] drivers/gpio: make gpio-xgene.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_XGENE
drivers/gpio/Kconfig: bool "APM X-Gene GPIO controller support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Feng Kan <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-xgene.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index c0aa387664bf..4193502fe3be 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -17,7 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

-#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
@@ -211,7 +210,6 @@ static const struct of_device_id xgene_gpio_of_match[] = {
{ .compatible = "apm,xgene-gpio", },
{},
};
-MODULE_DEVICE_TABLE(of, xgene_gpio_of_match);

static struct platform_driver xgene_gpio_driver = {
.driver = {
@@ -221,9 +219,4 @@ static struct platform_driver xgene_gpio_driver = {
},
.probe = xgene_gpio_probe,
};
-
-module_platform_driver(xgene_gpio_driver);
-
-MODULE_AUTHOR("Feng Kan <[email protected]>");
-MODULE_DESCRIPTION("APM X-Gene GPIO driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(xgene_gpio_driver);
--
2.6.1

2016-03-27 15:45:25

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 3/9] drivers/gpio: make gpio-mc9s08dz60.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MC9S08DZ60
drivers/gpio/Kconfig: bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_i2c_driver() uses the same init level priority as
builtin_i2c_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Wu Guoxing <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-mc9s08dz60.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-mc9s08dz60.c b/drivers/gpio/gpio-mc9s08dz60.c
index 14f252f9eb29..2fcad5b9cca5 100644
--- a/drivers/gpio/gpio-mc9s08dz60.c
+++ b/drivers/gpio/gpio-mc9s08dz60.c
@@ -15,7 +15,7 @@
*/

#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
@@ -111,8 +111,6 @@ static const struct i2c_device_id mc9s08dz60_id[] = {
{},
};

-MODULE_DEVICE_TABLE(i2c, mc9s08dz60_id);
-
static struct i2c_driver mc9s08dz60_i2c_driver = {
.driver = {
.name = "mc9s08dz60",
@@ -120,10 +118,4 @@ static struct i2c_driver mc9s08dz60_i2c_driver = {
.probe = mc9s08dz60_probe,
.id_table = mc9s08dz60_id,
};
-
-module_i2c_driver(mc9s08dz60_i2c_driver);
-
-MODULE_AUTHOR("Freescale Semiconductor, Inc. "
- "Wu Guoxing <[email protected]>");
-MODULE_DESCRIPTION("mc9s08dz60 gpio function on mx35 3ds board");
-MODULE_LICENSE("GPL v2");
+builtin_i2c_driver(mc9s08dz60_i2c_driver);
--
2.6.1

2016-03-27 15:46:13

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 6/9] drivers/gpio: make gpio-pl061.c explicitly non-modular

The Kconfig for this driver is currently:

config GPIO_PL061
bool "PrimeCell PL061 GPIO support"

...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, so that when reading the
driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Baruch Siach <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-pl061.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 5cb38212bbc0..9afb415a5d24 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2008, 2009 Provigent Ltd.
*
+ * Author: Baruch Siach <[email protected]>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@@ -11,7 +13,7 @@
*/
#include <linux/spinlock.h>
#include <linux/errno.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
@@ -429,8 +431,6 @@ static struct amba_id pl061_ids[] = {
{ 0, 0 },
};

-MODULE_DEVICE_TABLE(amba, pl061_ids);
-
static struct amba_driver pl061_gpio_driver = {
.drv = {
.name = "pl061_gpio",
@@ -446,8 +446,4 @@ static int __init pl061_gpio_init(void)
{
return amba_driver_register(&pl061_gpio_driver);
}
-module_init(pl061_gpio_init);
-
-MODULE_AUTHOR("Baruch Siach <[email protected]>");
-MODULE_DESCRIPTION("PL061 GPIO driver");
-MODULE_LICENSE("GPL");
+device_initcall(pl061_gpio_init);
--
2.6.1

2016-03-27 15:46:30

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 9/9] drivers/gpio: make gpio-zx.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

config GPIO_ZX
bool "ZTE ZX GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Jun Nie <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-zx.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c
index 47c79fa65670..93de8be0d885 100644
--- a/drivers/gpio/gpio-zx.c
+++ b/drivers/gpio/gpio-zx.c
@@ -1,4 +1,8 @@
/*
+ * ZTE ZX296702 GPIO driver
+ *
+ * Author: Jun Nie <[email protected]>
+ *
* Copyright (C) 2015 Linaro Ltd.
*
* This program is free software; you can redistribute it and/or modify
@@ -10,7 +14,7 @@
#include <linux/errno.h>
#include <linux/gpio/driver.h>
#include <linux/irqchip/chained_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
@@ -282,7 +286,6 @@ static const struct of_device_id zx_gpio_match[] = {
},
{ },
};
-MODULE_DEVICE_TABLE(of, zx_gpio_match);

static struct platform_driver zx_gpio_driver = {
.probe = zx_gpio_probe,
@@ -291,9 +294,4 @@ static struct platform_driver zx_gpio_driver = {
.of_match_table = of_match_ptr(zx_gpio_match),
},
};
-
-module_platform_driver(zx_gpio_driver)
-
-MODULE_AUTHOR("Jun Nie <[email protected]>");
-MODULE_DESCRIPTION("ZTE ZX296702 GPIO driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(zx_gpio_driver)
--
2.6.1

2016-03-27 15:45:19

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 2/9] drivers/gpio: make gpio-mb86s7x.c driver explicitly non-modular

The Kconfig for this driver is currently:

config GPIO_MB86S7X
bool "GPIO support for Fujitsu MB86S7x Platforms"

...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, so that when reading the
driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-mb86s7x.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c
index 7fffc1d6c055..d69bd24b241c 100644
--- a/drivers/gpio/gpio-mb86s7x.c
+++ b/drivers/gpio/gpio-mb86s7x.c
@@ -17,7 +17,6 @@
#include <linux/io.h>
#include <linux/init.h>
#include <linux/clk.h>
-#include <linux/module.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/ioport.h>
@@ -210,7 +209,6 @@ static const struct of_device_id mb86s70_gpio_dt_ids[] = {
{ .compatible = "fujitsu,mb86s70-gpio" },
{ /* sentinel */ }
};
-MODULE_DEVICE_TABLE(of, mb86s70_gpio_dt_ids);

static struct platform_driver mb86s70_gpio_driver = {
.driver = {
@@ -225,8 +223,4 @@ static int __init mb86s70_gpio_init(void)
{
return platform_driver_register(&mb86s70_gpio_driver);
}
-module_init(mb86s70_gpio_init);
-
-MODULE_DESCRIPTION("MB86S7x GPIO Driver");
-MODULE_ALIAS("platform:mb86s70-gpio");
-MODULE_LICENSE("GPL");
+device_initcall(mb86s70_gpio_init);
--
2.6.1

2016-03-27 15:46:58

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 7/9] drivers/gpio: make gpio-sta2x11.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_STA2X11
drivers/gpio/Kconfig: bool "STA2x11/ConneXt GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modularity, so that when reading
the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-sta2x11.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 0d5b8c525dd9..853ca23cad88 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -20,7 +20,7 @@
*
*/

-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/gpio.h>
@@ -432,8 +432,4 @@ static struct platform_driver sta2x11_gpio_platform_driver = {
},
.probe = gsta_probe,
};
-
-module_platform_driver(sta2x11_gpio_platform_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("sta2x11_gpio GPIO driver");
+builtin_platform_driver(sta2x11_gpio_platform_driver);
--
2.6.1

2016-03-27 15:47:16

by Paul Gortmaker

[permalink] [raw]
Subject: [PATCH 4/9] drivers/gpio: make gpio-moxart.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_MOXART
drivers/gpio/Kconfig: bool "MOXART GPIO support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular references so that when reading
the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We don't replace module.h with init.h since the file already has that.

Cc: Jonas Jensen <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
---
drivers/gpio/gpio-moxart.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-moxart.c b/drivers/gpio/gpio-moxart.c
index f02d0b490978..d58d38906ba6 100644
--- a/drivers/gpio/gpio-moxart.c
+++ b/drivers/gpio/gpio-moxart.c
@@ -15,7 +15,6 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/platform_device.h>
-#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_gpio.h>
#include <linux/pinctrl/consumer.h>
@@ -82,8 +81,4 @@ static struct platform_driver moxart_gpio_driver = {
},
.probe = moxart_gpio_probe,
};
-module_platform_driver(moxart_gpio_driver);
-
-MODULE_DESCRIPTION("MOXART GPIO chip driver");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jonas Jensen <[email protected]>");
+builtin_platform_driver(moxart_gpio_driver);
--
2.6.1

2016-03-27 17:40:18

by Baruch Siach

[permalink] [raw]
Subject: Re: [PATCH 6/9] drivers/gpio: make gpio-pl061.c explicitly non-modular

Hi Paul,

On Sun, Mar 27, 2016 at 11:44:46AM -0400, Paul Gortmaker wrote:
> The Kconfig for this driver is currently:
>
> config GPIO_PL061
> bool "PrimeCell PL061 GPIO support"
>
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the couple traces of modularity, so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Baruch Siach <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Acked-by: Baruch Siach <[email protected]>

Thanks,
baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -

2016-03-31 10:01:48

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/9] drivers/gpio: make gpio-bcm-kona.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> config GPIO_BCM_KONA
> bool "Broadcom Kona GPIO"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modularity so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
>
> Cc: Ray Jui <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:01:09

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 2/9] drivers/gpio: make gpio-mb86s7x.c driver explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig for this driver is currently:
>
> config GPIO_MB86S7X
> bool "GPIO support for Fujitsu MB86S7x Platforms"
>
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the couple traces of modularity, so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:02:43

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 3/9] drivers/gpio: make gpio-mc9s08dz60.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/gpio/Kconfig:config GPIO_MC9S08DZ60
> drivers/gpio/Kconfig: bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_i2c_driver() uses the same init level priority as
> builtin_i2c_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Wu Guoxing <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:03:57

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 4/9] drivers/gpio: make gpio-moxart.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/gpio/Kconfig:config GPIO_MOXART
> drivers/gpio/Kconfig: bool "MOXART GPIO support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modular references so that when reading
> the driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> We don't replace module.h with init.h since the file already has that.
>
> Cc: Jonas Jensen <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:05:20

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 5/9] drivers/gpio: make gpio-mvebu.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/gpio/Kconfig:config GPIO_MVEBU
> drivers/gpio/Kconfig: def_bool y
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modularity so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:06:53

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 6/9] drivers/gpio: make gpio-pl061.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig for this driver is currently:
>
> config GPIO_PL061
> bool "PrimeCell PL061 GPIO support"
>
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the couple traces of modularity, so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Baruch Siach <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied with Baruch's ACK.

Yours,
Linus Walleij

2016-03-31 13:08:33

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 7/9] drivers/gpio: make gpio-sta2x11.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/gpio/Kconfig:config GPIO_STA2X11
> drivers/gpio/Kconfig: bool "STA2x11/ConneXt GPIO support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modularity, so that when reading
> the driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:09:58

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 8/9] drivers/gpio: make gpio-xgene.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/gpio/Kconfig:config GPIO_XGENE
> drivers/gpio/Kconfig: bool "APM X-Gene GPIO controller support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Feng Kan <[email protected]>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:11:04

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 9/9] drivers/gpio: make gpio-zx.c explicitly non-modular

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> config GPIO_ZX
> bool "ZTE ZX GPIO support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modularity so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: Jun Nie <[email protected]>
> Cc: [email protected]
> Signed-off-by: Paul Gortmaker <[email protected]>

Patch applied.

Yours,
Linus Walleij

2016-03-31 13:12:14

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/9] gpio: batch #1: remove modular usage from non-modular drivers

On Sun, Mar 27, 2016 at 5:44 PM, Paul Gortmaker
<[email protected]> wrote:

> I will send #2 once this #1 is finalized/merged and #3 once #2 is merged.

I merged the first set.

Thank you for your tireless efforts in cleaning upp this mess.

Yours,
Linus Walleij