Re: [PATCH v7 1/6] fieldbus_dev: add Fieldbus Device subsystem.

2019-01-22 Thread Paul Gortmaker
[Re: [PATCH v7 1/6] fieldbus_dev: add Fieldbus Device subsystem.] On 22/01/2019 
(Tue 19:52) Greg KH wrote:

> On Tue, Jan 22, 2019 at 06:12:31PM +0100, Andreas Färber wrote:
> > Am 22.01.19 um 17:56 schrieb Paul Gortmaker:
> > > [[PATCH v7 1/6] fieldbus_dev: add Fieldbus Device subsystem.] On 
> > > 22/01/2019 (Tue 10:21) Sven Van Asbroeck wrote:

[...]

> > >> diff --git a/drivers/fieldbus/Kconfig b/drivers/fieldbus/Kconfig
> > >> new file mode 100644
> > >> index ..5c2bef950d04
> > >> --- /dev/null
> > >> +++ b/drivers/fieldbus/Kconfig
> > >> @@ -0,0 +1,19 @@
> > >> +menuconfig FIELDBUS_DEV
> > >> +bool "Fieldbus Device Support"
> > > 
> > > OK, so the core support is NOT tristate, ie not modular,
> > 
> > Is that intentional though, and if so, why?
> > 
> > If possible, I would much rather see it changed to tristate and leave
> > all the metadata below.

[...]

> And I thought when I made the comment about this code being a module,
> that would be the change, not this one forcing it not to be :(

Apologies Greg, I didn't see that earlier comment.

Conversion to tristate is of course perfectly fine as well; I'm just
against the inconsistency and addition of unused code.  But tristate
solves both, and I usually mention that (but not this time...)

I just default to suggesting removing the unused stuff, since it doesn't
change the runtime or implicitly expand the use case beyond what the
original author(s) intended.  Many times (just as here with fieldbus)
I just don't know enough about it to say whether modular has a use case.

Paul.
--

> 
> thanks,
> 
> greg k-h


[PATCH-next] reset: brcmstb: make it explicitly non-modular

2019-01-22 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:  bool "Broadcom STB reset controller" if COMPILE_TEST
drivers/reset/Kconfig:  default ARCH_BRCMSTB

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

Lets remove the couple traces of modular infrastructure use, 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 no-op MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Philipp Zabel 
Cc: Brian Norris 
Cc: Gregory Fong 
Cc: Florian Fainelli 
Cc: bcm-kernel-feedback-l...@broadcom.com
Signed-off-by: Paul Gortmaker 
---

[Driver just recently appeared in linux-next - if rebasing, feel free
 to squash this change into the original commit. Or make it tristate?]

 drivers/reset/reset-brcmstb.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/reset/reset-brcmstb.c b/drivers/reset/reset-brcmstb.c
index 01ab1f71518b..5bc0c74cf97c 100644
--- a/drivers/reset/reset-brcmstb.c
+++ b/drivers/reset/reset-brcmstb.c
@@ -8,7 +8,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -123,8 +123,4 @@ static struct platform_driver brcmstb_reset_driver = {
.of_match_table = brcmstb_reset_of_match,
},
 };
-module_platform_driver(brcmstb_reset_driver);
-
-MODULE_AUTHOR("Broadcom");
-MODULE_DESCRIPTION("Broadcom STB reset controller");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(brcmstb_reset_driver);
-- 
2.7.4



Re: [PATCH v7 1/6] fieldbus_dev: add Fieldbus Device subsystem.

2019-01-22 Thread Paul Gortmaker
[[PATCH v7 1/6] fieldbus_dev: add Fieldbus Device subsystem.] On 22/01/2019 
(Tue 10:21) Sven Van Asbroeck wrote:

> Fieldbus device (client) adapters allow data exchange with a PLC aka.
> "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.)
> 
> They are typically used when a Linux device wants to expose itself
> as an actuator, motor, console light, switch, etc. over the fieldbus.
> 
> This framework is designed to provide a generic interface to Fieldbus
> Devices from both the Linux Kernel and the userspace.
> 
> Signed-off-by: Sven Van Asbroeck 

[...]

> diff --git a/drivers/fieldbus/Kconfig b/drivers/fieldbus/Kconfig
> new file mode 100644
> index ..5c2bef950d04
> --- /dev/null
> +++ b/drivers/fieldbus/Kconfig
> @@ -0,0 +1,19 @@
> +menuconfig FIELDBUS_DEV
> + bool "Fieldbus Device Support"

OK, so the core support is NOT tristate, ie not modular, so I think...

> diff --git a/drivers/fieldbus/dev_core.c b/drivers/fieldbus/dev_core.c
> new file mode 100644
> index ..c816df3201bb
> --- /dev/null
> +++ b/drivers/fieldbus/dev_core.c
> @@ -0,0 +1,348 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Fieldbus Device Driver Core
> + *
> + */
> +
> +#include 
> +#include 
> +#include 

...you don't need module.h here

> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +

[...]

> +
> +static void __exit fieldbus_exit(void)
> +{
> + unregister_chrdev_region(fieldbus_devt, MAX_FIELDBUSES);
> + class_unregister(_class);
> +}
> +
> +subsys_initcall(fieldbus_init);
> +module_exit(fieldbus_exit);

...and the module_exit is never called, so fieldbus_exit is dead code
and hence both should be removed.

> +
> +MODULE_AUTHOR("Sven Van Asbroeck ");
> +MODULE_AUTHOR("Jonathan Stiles ");
> +MODULE_DESCRIPTION("Fieldbus Device Driver Core");
> +MODULE_LICENSE("GPL v2");

And these are all no-ops for non-modules, so it is recommended that you
instead capture the information at the top of the file in comments.

You can find many similar cleanups for reference with this search:

   git log  --no-merges --oneline --grep='make .* non-modular'

Thanks,
Paul.
--


Re: linux-next: Fixes tags need some work in the pm tree

2019-01-15 Thread Paul Gortmaker
[Re: linux-next: Fixes tags need some work in the pm tree] On 16/01/2019 (Wed 
00:06) Rafael J. Wysocki wrote:

> On Tuesday, January 15, 2019 11:43:05 PM CET Stephen Rothwell wrote:
> > Hi Rafael,
> > 
> > On Tue, 15 Jan 2019 23:13:16 +0100 "Rafael J. Wysocki"  
> > wrote:
> > >
> > > On Tuesday, January 15, 2019 9:55:40 PM CET Stephen Rothwell wrote:
> > > > [I am experimenting with checking the Fixes tags in commits in 
> > > > linux-next.
> > > > Please let me know if you think I am being too strict.]
> > > > 
> > > > Hi Rafael,
> > > > 
> > > > Commits
> > > > 
> > > >   62b33d57c534 ("drivers: thermal: int340x_thermal: Make PCI dependency 
> > > > explicit")
> > > >   cd793ab22a93 ("x86/intel/lpss: Make PCI dependency explicit")
> > > >   42ac19e7b81e ("ACPI: EC: Look for ECDT EC after calling 
> > > > acpi_load_tables()")
> > > >   6c29b81b5695 ("platform/x86: apple-gmux: Make PCI dependency 
> > > > explicit")
> > > >   34783dc0182a ("platform/x86: intel_pmc: Make PCI dependency explicit")
> > > >   704658d1d3ae ("platform/x86: intel_ips: make PCI dependency explicit")
> > > >   5df37f3a1aa9 ("vga-switcheroo: make PCI dependency explicit")
> > > >   da1df6ee4296 ("ata: pata_acpi: Make PCI dependency explicit")
> > > >   ce97a22a596b ("ACPI / LPSS: Make PCI dependency explicit")
> > > > 
> > > > Have malformed Fixes tags:
> > > > 
> > > > There should be double quotes around the commit subject.  
> > > 
> > > Well, where does this requirement come from?
> > > 
> > > It hasn't been there before AFAICS.
> > 
> > Documentation/process/submitting-patches.rst has the following, but I
> > am sure people are happy to discuss changes and it does say "For
> > example", so maybe I am being to strict?
> 
> If that's the source of it, then it's rather weak IMO.

Rafael, allow me to rewind a bit, and add context you would not have...

A quick on-the-fly script shows we have a lot of "Fixes:" tags that
either have bad (rebased/gone) commit IDs and/or non-standard
formatting.

The biggest issue is having commits in mainline that reference a commit
ID in a Fixes: tag that doesn't exist - for one reason or another.  Once
that is in mainline, we can't correct it.  It is there forever.

Doing a sanity check for that in linux-next seems like a good place to
check for this and prevent it.  And if we sanity check for one thing, we
can sanity check for other common issues.  Hence the less important
formatting checks.

> Formal requirements should be documented as such and I would expect that
> to happen through the usual process: patch submission, review, acceptance etc.

I'd rather not misinterpret this as a formal requirement.  We just want
to catch bad SHA IDs in Fixes: and also help our friends doing the
linux-stable releases so they can parse those Fixes: fields more easily
and reliably.

I'd like to think we all can support the work the linux-stable people do
and stand behind doing whatever we can to help them.  At the same time,
people (maintainers and submitters) have the choice to ignore the
e-mails that suggest "Fixes:" changes, if they feel they are invalid.
And suggestions for improvements in parsing etc etc are always welcome.

Thanks,
Paul.
--


Re: linux-next: Fixes tag needs some work in the nfs-anna tree

2019-01-15 Thread Paul Gortmaker
[Re: linux-next: Fixes tag needs some work in the nfs-anna tree] On 15/01/2019 
(Tue 23:12) Takashi Iwai wrote:

> On Tue, 15 Jan 2019 22:41:21 +0100,
> Chuck Lever wrote:
> > 
> > Hi Stephen-
> > 
> > On Jan 15, 2019, at 4:38 PM, Stephen Rothwell  wrote:
> > 
> > > [I am experimenting with checking the Fixes tags in commits in linux-next.
> > > Please let me know if you think I am being too strict.]
> > > 
> > > Hi all,
> > > 
> > > Commit
> > > 
> > >  deaa5c96c2f7 ("SUNRPC: Address Kerberos performance/behavior regression")
> > > 
> > > has problem with this Fixes tag:
> > > 
> > >  Fixes: 918f3c1fe83c ("SUNRPC: Improve latency for interactive ... ")
> > > 
> > > The subject should match the subject of the fixed commit.
> > > 
> > > -- 
> > > Cheers,
> > > Stephen Rothwell
> > 
> > I shortened the commit title so that the Fixes: line is shorter than 68
> > characters. I can leave these titles alone if that's preferred.
> 
> I've sometimes shorted the subject like the above, too, as I find a
> too long text annoying.  Maybe the partial string matching should
> suffice, especially when it ends with "..." ?

The problem is consistency.  Perhaps you shorten at four words.  A
person searches with five words or 70 chars -  they never see your commit.

The idea of consistency across the "Fixes:" tags is to allow a level of
automated processing so that the creators of the stable releases can do
a lot less manual hands-on processing.  They have enough work to do.

Thanks,
Paul.
--

> 
> 
> thanks,
> 
> Takashi


[PATCH 05/18] mfd: htc-i2cpld: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig for this option is currently:

config HTC_I2CPLD
bool "HTC I2C PLD chip 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_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: Cory Maccarrone 
Cc: Lee Jones 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/htc-i2cpld.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 01572b5e79e8..af3c66355270 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -27,7 +27,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -614,8 +613,6 @@ static const struct i2c_device_id htcpld_chip_id[] = {
{ "htcpld-chip", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, htcpld_chip_id);
-
 
 static struct i2c_driver htcpld_chip_driver = {
.driver = {
@@ -643,17 +640,4 @@ static int __init htcpld_core_init(void)
/* Probe for our chips */
return platform_driver_probe(_core_driver, htcpld_core_probe);
 }
-
-static void __exit htcpld_core_exit(void)
-{
-   i2c_del_driver(_chip_driver);
-   platform_driver_unregister(_core_driver);
-}
-
-module_init(htcpld_core_init);
-module_exit(htcpld_core_exit);
-
-MODULE_AUTHOR("Cory Maccarrone ");
-MODULE_DESCRIPTION("I2C HTC PLD Driver");
-MODULE_LICENSE("GPL");
-
+device_initcall(htcpld_core_init);
-- 
2.7.4



[PATCH 01/18] mfd: aat2870-core: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AAT2870_CORE
drivers/mfd/Kconfig:bool "AnalogicTech AAT2870"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Jin Park 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Jin Park 
---
 drivers/mfd/aat2870-core.c | 40 +++-
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 3ba19a45f199..9d3d90d386c2 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -20,7 +20,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -349,18 +348,10 @@ static void aat2870_init_debugfs(struct aat2870_data 
*aat2870)
 "Failed to create debugfs register file\n");
 }
 
-static void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-   debugfs_remove_recursive(aat2870->dentry_root);
-}
 #else
 static inline void aat2870_init_debugfs(struct aat2870_data *aat2870)
 {
 }
-
-static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-}
 #endif /* CONFIG_DEBUG_FS */
 
 static int aat2870_i2c_probe(struct i2c_client *client,
@@ -440,20 +431,6 @@ static int aat2870_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int aat2870_i2c_remove(struct i2c_client *client)
-{
-   struct aat2870_data *aat2870 = i2c_get_clientdata(client);
-
-   aat2870_uninit_debugfs(aat2870);
-
-   mfd_remove_devices(aat2870->dev);
-   aat2870_disable(aat2870);
-   if (aat2870->uninit)
-   aat2870->uninit(aat2870);
-
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
@@ -492,15 +469,14 @@ static const struct i2c_device_id aat2870_i2c_id_table[] 
= {
{ "aat2870", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table);
 
 static struct i2c_driver aat2870_i2c_driver = {
.driver = {
-   .name   = "aat2870",
-   .pm = _pm_ops,
+   .name   = "aat2870",
+   .pm = _pm_ops,
+   .suppress_bind_attrs= true,
},
.probe  = aat2870_i2c_probe,
-   .remove = aat2870_i2c_remove,
.id_table   = aat2870_i2c_id_table,
 };
 
@@ -509,13 +485,3 @@ static int __init aat2870_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(aat2870_init);
-
-static void __exit aat2870_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(aat2870_exit);
-
-MODULE_DESCRIPTION("Core support for the AnalogicTech AAT2870");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jin Park ");
-- 
2.7.4



[PATCH 11/18] mfd: tps65910: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65910
drivers/mfd/Kconfig-bool "TI TPS65910 Power Management chip"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
We do delete an unused moduleparam.h include though.

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: Tony Lindgren 
Cc: Lee Jones 
Cc: Graeme Gregory 
Cc: Jorge Eduardo Candelaria 
Cc: linux-o...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Tony Lindgren 
---
 drivers/mfd/tps65910.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf16cbe6fd88..aa3d472a10ff 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -1,5 +1,5 @@
 /*
- * tps65910.c  --  TI TPS6591x
+ * tps65910.c  --  TI TPS6591x chip family multi-function driver
  *
  * Copyright 2010 Texas Instruments Inc.
  *
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
{ },
 };
-MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
unsigned long *chip_id)
@@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
{ "tps65911", TPS65911 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
-
 
 static struct i2c_driver tps65910_i2c_driver = {
.driver = {
@@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(tps65910_i2c_init);
-
-static void __exit tps65910_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(tps65910_i2c_exit);
-
-MODULE_AUTHOR("Graeme Gregory ");
-MODULE_AUTHOR("Jorge Eduardo Candelaria ");
-MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 15/18] mfd: wm831x-core: drop unused module infrastructure from non-modular code

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X
drivers/mfd/Kconfig:bool

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

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

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

Previous demodularizaion work has made wm831x_device_exit() no longer
used, so it is also removed from the 831x core code.

Cc: Lee Jones 
Cc: Charles Keepax 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm831x-core.c   | 15 ++-
 include/linux/mfd/wm831x/core.h |  1 -
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index e70d35ef5c6d..25fbbaf39cb9 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1892,14 +1893,6 @@ int wm831x_device_init(struct wm831x *wm831x, int irq)
return ret;
 }
 
-void wm831x_device_exit(struct wm831x *wm831x)
-{
-   wm831x_otp_exit(wm831x);
-   mfd_remove_devices(wm831x->dev);
-   free_irq(wm831x_irq(wm831x, WM831X_IRQ_AUXADC_DATA), wm831x);
-   wm831x_irq_exit(wm831x);
-}
-
 int wm831x_device_suspend(struct wm831x *wm831x)
 {
int reg, mask;
@@ -1944,7 +1937,3 @@ void wm831x_device_shutdown(struct wm831x *wm831x)
}
 }
 EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
-
-MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index b49fa67612f1..6fcb8eb00282 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -418,7 +418,6 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short 
reg,
 int count, u16 *buf);
 
 int wm831x_device_init(struct wm831x *wm831x, int irq);
-void wm831x_device_exit(struct wm831x *wm831x);
 int wm831x_device_suspend(struct wm831x *wm831x);
 void wm831x_device_shutdown(struct wm831x *wm831x);
 int wm831x_irq_init(struct wm831x *wm831x, int irq);
-- 
2.7.4



[PATCH 14/18] mfd: wm831x-i2c: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm831x-i2c.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c
index 22f7054d1b28..0f3af42f7268 100644
--- a/drivers/mfd/wm831x-i2c.c
+++ b/drivers/mfd/wm831x-i2c.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,15 +68,6 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
return wm831x_device_init(wm831x, i2c->irq);
 }
 
-static int wm831x_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm831x *wm831x = i2c_get_clientdata(i2c);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_i2c_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -103,7 +94,6 @@ static const struct i2c_device_id wm831x_i2c_id[] = {
{ "wm8326", WM8326 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
 
 static const struct dev_pm_ops wm831x_pm_ops = {
.suspend = wm831x_i2c_suspend,
@@ -115,9 +105,9 @@ static struct i2c_driver wm831x_i2c_driver = {
.name = "wm831x",
.pm = _pm_ops,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.probe = wm831x_i2c_probe,
-   .remove = wm831x_i2c_remove,
.id_table = wm831x_i2c_id,
 };
 
@@ -132,9 +122,3 @@ static int __init wm831x_i2c_init(void)
return ret;
 }
 subsys_initcall(wm831x_i2c_init);
-
-static void __exit wm831x_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm831x_i2c_exit);
-- 
2.7.4



[PATCH 13/18] mfd: wm831x-spi: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_SPI
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with SPI"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/wm831x-spi.c | 24 ++--
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 018ce652ae57..dd4dab419940 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,15 +67,6 @@ static int wm831x_spi_probe(struct spi_device *spi)
return wm831x_device_init(wm831x, spi->irq);
 }
 
-static int wm831x_spi_remove(struct spi_device *spi)
-{
-   struct wm831x *wm831x = spi_get_drvdata(spi);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_spi_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -108,17 +99,16 @@ static const struct spi_device_id wm831x_spi_ids[] = {
{ "wm8326", WM8326 },
{ },
 };
-MODULE_DEVICE_TABLE(spi, wm831x_spi_ids);
 
 static struct spi_driver wm831x_spi_driver = {
.driver = {
.name   = "wm831x",
.pm = _spi_pm,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.id_table   = wm831x_spi_ids,
.probe  = wm831x_spi_probe,
-   .remove = wm831x_spi_remove,
 };
 
 static int __init wm831x_spi_init(void)
@@ -132,13 +122,3 @@ static int __init wm831x_spi_init(void)
return 0;
 }
 subsys_initcall(wm831x_spi_init);
-
-static void __exit wm831x_spi_exit(void)
-{
-   spi_unregister_driver(_spi_driver);
-}
-module_exit(wm831x_spi_exit);
-
-MODULE_DESCRIPTION("SPI support for WM831x/2x AudioPlus PMICs");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
-- 
2.7.4



[PATCH 10/18] mfd: tps65090: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65090
drivers/mfd/Kconfig:bool "TI TPS65090 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Venu Byravarasu 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/tps65090.c | 30 +-
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index f13e4cd06e89..6968df4d7828 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -2,7 +2,9 @@
  * Core driver for TI TPS65090 PMIC family
  *
  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
-
+ *
+ * Author: Venu Byravarasu 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -171,7 +173,6 @@ static const struct of_device_id tps65090_of_match[] = {
{ .compatible = "ti,tps65090",},
{},
 };
-MODULE_DEVICE_TABLE(of, tps65090_of_match);
 #endif
 
 static int tps65090_i2c_probe(struct i2c_client *client,
@@ -236,30 +237,19 @@ static int tps65090_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps65090_i2c_remove(struct i2c_client *client)
-{
-   struct tps65090 *tps65090 = i2c_get_clientdata(client);
-
-   mfd_remove_devices(tps65090->dev);
-   if (client->irq)
-   regmap_del_irq_chip(client->irq, tps65090->irq_data);
-
-   return 0;
-}
 
 static const struct i2c_device_id tps65090_id_table[] = {
{ "tps65090", 0 },
{ },
 };
-MODULE_DEVICE_TABLE(i2c, tps65090_id_table);
 
 static struct i2c_driver tps65090_driver = {
.driver = {
.name   = "tps65090",
+   .suppress_bind_attrs = true,
.of_match_table = of_match_ptr(tps65090_of_match),
},
.probe  = tps65090_i2c_probe,
-   .remove = tps65090_i2c_remove,
.id_table   = tps65090_id_table,
 };
 
@@ -268,13 +258,3 @@ static int __init tps65090_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps65090_init);
-
-static void __exit tps65090_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps65090_exit);
-
-MODULE_DESCRIPTION("TPS65090 core driver");
-MODULE_AUTHOR("Venu Byravarasu ");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 04/18] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
drivers/mfd/Kconfig:bool "ST-Ericsson DB8500 Power Reset Control Management 
Unit"

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: Mattias Nilsson 
Signed-off-by: Paul Gortmaker 
Reviewed-by: Linus Walleij 
---
 drivers/mfd/db8500-prcmu.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index aec20e1c7d3d..65666b624ae8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1,4 +1,6 @@
 /*
+ * DB8500 PRCM Unit driver
+ *
  * Copyright (C) STMicroelectronics 2009
  * Copyright (C) ST-Ericsson SA 2010
  *
@@ -10,7 +12,8 @@
  * U8500 PRCM Unit interface driver
  *
  */
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -3188,9 +3191,4 @@ static int __init db8500_prcmu_init(void)
 {
return platform_driver_register(_prcmu_driver);
 }
-
 core_initcall(db8500_prcmu_init);
-
-MODULE_AUTHOR("Mattias Nilsson ");
-MODULE_DESCRIPTION("DB8500 PRCM Unit driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 07/18] mfd: rc5t583: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_RC5T583
drivers/mfd/Kconfig:bool "Ricoh RC5T583 Power Management system device"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Laxman Dewangan 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Laxman Dewangan 
---
 drivers/mfd/rc5t583.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index fd46de02b715..c5cc5cb3dde7 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -298,8 +297,6 @@ static const struct i2c_device_id rc5t583_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
-
 static struct i2c_driver rc5t583_i2c_driver = {
.driver = {
   .name = "rc5t583",
@@ -313,14 +310,3 @@ static int __init rc5t583_i2c_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(rc5t583_i2c_init);
-
-static void __exit rc5t583_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-
-module_exit(rc5t583_i2c_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("RICOH RC5T583 power management system device driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 08/18] mfd: sta2x11: drop unused MODULE_ tags from non-modular code

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_STA2X11
drivers/mfd/Kconfig:bool "STMicroelectronics STA2X11"

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

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Lee Jones 
Cc: Alessandro Rubini 
Cc: Davide Ciminaghi 
Signed-off-by: Paul Gortmaker 
Acked-by: Alessandro Rubini 
Acked-by: Davide Ciminaghi 
Acked-by: Linus Walleij 
---
 drivers/mfd/sta2x11-mfd.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 3aeafa228baf..cab9aabcaa1f 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -1,4 +1,6 @@
 /*
+ * STA2x11 mfd for GPIO, SCTL and APBREG
+ *
  * Copyright (c) 2009-2011 Wind River Systems, Inc.
  * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini, Davide Ciminaghi)
  *
@@ -18,7 +20,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -653,8 +656,3 @@ static int __init sta2x11_mfd_init(void)
  */
 subsys_initcall(sta2x11_drivers_init);
 rootfs_initcall(sta2x11_mfd_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wind River");
-MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
-MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);
-- 
2.7.4



[PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8350 with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
But we do delete an unused moduleparam.h

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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm8350-i2c.c | 24 +---
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 9358f03b7938..b4194e068e1b 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -48,30 +46,19 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
return wm8350_device_init(wm8350, i2c->irq, pdata);
 }
 
-static int wm8350_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
-
-   wm8350_device_exit(wm8350);
-
-   return 0;
-}
-
 static const struct i2c_device_id wm8350_i2c_id[] = {
{ "wm8350", 0 },
{ "wm8351", 0 },
{ "wm8352", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8350_i2c_id);
-
 
 static struct i2c_driver wm8350_i2c_driver = {
.driver = {
   .name = "wm8350",
+  .suppress_bind_attrs = true,
},
.probe = wm8350_i2c_probe,
-   .remove = wm8350_i2c_remove,
.id_table = wm8350_i2c_id,
 };
 
@@ -81,12 +68,3 @@ static int __init wm8350_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(wm8350_i2c_init);
-
-static void __exit wm8350_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm8350_i2c_exit);
-
-MODULE_DESCRIPTION("I2C support for the WM8350 AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 12/18] mfd: tps80031: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS80031
drivers/mfd/Kconfig:bool "TI TPS80031/TPS80032 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Laxman Dewangan 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Laxman Dewangan 
---
 drivers/mfd/tps80031.c | 37 ++---
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index 608c7f77830e..865257ade8ac 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -516,40 +515,18 @@ static int tps80031_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps80031_remove(struct i2c_client *client)
-{
-   struct tps80031 *tps80031 = i2c_get_clientdata(client);
-   int i;
-
-   if (tps80031_power_off_dev == tps80031) {
-   tps80031_power_off_dev = NULL;
-   pm_power_off = NULL;
-   }
-
-   mfd_remove_devices(tps80031->dev);
-
-   regmap_del_irq_chip(client->irq, tps80031->irq_data);
-
-   for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
-   if (tps80031->clients[i] != client)
-   i2c_unregister_device(tps80031->clients[i]);
-   }
-   return 0;
-}
-
 static const struct i2c_device_id tps80031_id_table[] = {
{ "tps80031", TPS80031 },
{ "tps80032", TPS80032 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
 
 static struct i2c_driver tps80031_driver = {
.driver = {
-   .name   = "tps80031",
+   .name   = "tps80031",
+   .suppress_bind_attrs= true,
},
.probe  = tps80031_probe,
-   .remove = tps80031_remove,
.id_table   = tps80031_id_table,
 };
 
@@ -558,13 +535,3 @@ static int __init tps80031_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps80031_init);
-
-static void __exit tps80031_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps80031_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("TPS80031 core driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8400
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8400"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

A trivial function rename from wm8400_module_init to the name
wm8400_driver_init is also done to reduce possible confusion.

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: Lee Jones 
Cc: Mark Brown 
Cc: Charles Keepax 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm8400-core.c | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 8a98a2fc74e1..79756c83f5f0 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -12,7 +12,7 @@
  *
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -150,7 +150,6 @@ static const struct i2c_device_id wm8400_i2c_id[] = {
{ "wm8400", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
 
 static struct i2c_driver wm8400_i2c_driver = {
.driver = {
@@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
 };
 #endif
 
-static int __init wm8400_module_init(void)
+static int __init wm8400_driver_init(void)
 {
int ret = -ENODEV;
 
@@ -173,15 +172,4 @@ static int __init wm8400_module_init(void)
 
return ret;
 }
-subsys_initcall(wm8400_module_init);
-
-static void __exit wm8400_module_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-   i2c_del_driver(_i2c_driver);
-#endif
-}
-module_exit(wm8400_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown ");
+subsys_initcall(wm8400_driver_init);
-- 
2.7.4



[PATCH 02/18] mfd: adp5520: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Makefile/Kconfig currently controlling compilation of this code is:

drivers/mfd/Makefile:obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
drivers/mfd/Kconfig:config PMIC_ADP5520
drivers/mfd/Kconfig:bool "Analog Devices ADP5520/01 MFD PMIC Core 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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

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
was (or is now) contained at the top of the file in the comments.

Cc: Michael Hennerich 
Cc: Lee Jones 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
Acked-by: Michael Hennerich 
---
 drivers/mfd/adp5520.c | 30 +++---
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index be0497b96720..2cdd39cb8a18 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -7,6 +7,8 @@
  *
  * Copyright 2009 Analog Devices Inc.
  *
+ * Author: Michael Hennerich 
+ *
  * Derived from da903x:
  * Copyright (C) 2008 Compulab, Ltd.
  * Mike Rapoport 
@@ -18,7 +20,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -304,18 +306,6 @@ static int adp5520_probe(struct i2c_client *client,
return ret;
 }
 
-static int adp5520_remove(struct i2c_client *client)
-{
-   struct adp5520_chip *chip = dev_get_drvdata(>dev);
-
-   if (chip->irq)
-   free_irq(chip->irq, chip);
-
-   adp5520_remove_subdevs(chip);
-   adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
@@ -346,20 +336,14 @@ static const struct i2c_device_id adp5520_id[] = {
{ "pmic-adp5501", ID_ADP5501 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, adp5520_id);
 
 static struct i2c_driver adp5520_driver = {
.driver = {
-   .name   = "adp5520",
-   .pm = _pm,
+   .name   = "adp5520",
+   .pm = _pm,
+   .suppress_bind_attrs= true,
},
.probe  = adp5520_probe,
-   .remove = adp5520_remove,
.id_table   = adp5520_id,
 };
-
-module_i2c_driver(adp5520_driver);
-
-MODULE_AUTHOR("Michael Hennerich ");
-MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(adp5520_driver);
-- 
2.7.4



[PATCH 09/18] mfd: syscon: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SYSCON
drivers/mfd/Kconfig:bool "System Controller Register R/W Based on Regmap"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Arnd Bergmann 
Cc: Dong Aisheng 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/syscon.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b6d05cd934e6..0ecdffb3d967 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -272,13 +272,3 @@ static int __init syscon_init(void)
return platform_driver_register(_driver);
 }
 postcore_initcall(syscon_init);
-
-static void __exit syscon_exit(void)
-{
-   platform_driver_unregister(_driver);
-}
-module_exit(syscon_exit);
-
-MODULE_AUTHOR("Dong Aisheng ");
-MODULE_DESCRIPTION("System Control driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 17/18] mfd: wm8350-core: drop unused module infrastructure from non-modular code

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350
drivers/mfd/Kconfig:bool

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Previous demodularizaion work has made wm8350_device_exit() no longer
used, so it is also removed from the 8350 core code.

Cc: Linus Walleij 
Cc: Charles Keepax 
Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm8350-core.c   | 30 ++
 include/linux/mfd/wm8350/core.h |  1 -
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 8a07c5634aee..9e1070f26b11 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -442,30 +443,3 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
return ret;
 }
 EXPORT_SYMBOL_GPL(wm8350_device_init);
-
-void wm8350_device_exit(struct wm8350 *wm8350)
-{
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.led); i++)
-   platform_device_unregister(wm8350->pmic.led[i].pdev);
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++)
-   platform_device_unregister(wm8350->pmic.pdev[i]);
-
-   platform_device_unregister(wm8350->wdt.pdev);
-   platform_device_unregister(wm8350->rtc.pdev);
-   platform_device_unregister(wm8350->power.pdev);
-   platform_device_unregister(wm8350->hwmon.pdev);
-   platform_device_unregister(wm8350->gpio.pdev);
-   platform_device_unregister(wm8350->codec.pdev);
-
-   if (wm8350->irq_base)
-   free_irq(wm8350->irq_base + WM8350_IRQ_AUXADC_DATARDY, wm8350);
-
-   wm8350_irq_exit(wm8350);
-}
-EXPORT_SYMBOL_GPL(wm8350_device_exit);
-
-MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver");
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 509481d9cf19..202d9bde2c7c 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -643,7 +643,6 @@ struct wm8350_platform_data {
  */
 int wm8350_device_init(struct wm8350 *wm8350, int irq,
   struct wm8350_platform_data *pdata);
-void wm8350_device_exit(struct wm8350 *wm8350);
 
 /*
  * WM8350 device IO
-- 
2.7.4



[PATCH 03/18] mfd: as3711: Make it explicitly non-modular

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:bool "AMS AS3711"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Guennadi Liakhovetski 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/as3711.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 67b12417585d..7a74a874b93c 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -118,7 +117,6 @@ static const struct of_device_id as3711_of_match[] = {
{.compatible = "ams,as3711",},
{}
 };
-MODULE_DEVICE_TABLE(of, as3711_of_match);
 #endif
 
 static int as3711_i2c_probe(struct i2c_client *client,
@@ -202,8 +200,6 @@ static const struct i2c_device_id as3711_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
-
 static struct i2c_driver as3711_i2c_driver = {
.driver = {
   .name = "as3711",
@@ -219,13 +215,3 @@ static int __init as3711_i2c_init(void)
 }
 /* Initialise early */
 subsys_initcall(as3711_i2c_init);
-
-static void __exit as3711_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(as3711_i2c_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski ");
-MODULE_DESCRIPTION("AS3711 PMIC driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH v5 00/18] mfd: demodularization of non-modular drivers

2019-01-13 Thread Paul Gortmaker
[v4 --> v5: add more acks, re-do build tests on newest linux-next after
the 5.0 merge window closed.]

[v3 --> v4: delete now unused exit fcn from wm835x core; add more acks
 now all in chrono order, re-test.]

[v2 --> v3: drop diasemi commits as they will be modularized; delete
 now unused exit fcn from wm831x core; add more acks; re-test.]

[v1 --> v2: add some more commits as requested by Lee (MFD maintainer),
 update the 00/NN text; re-do build and link testing on new linux-next. ]

This group of MFD drivers are all controlled by "bool" Kconfig settings,
but contain various amounts of largely pointless uses of infrastructure
related to modular operations, even though they can't be built modular.

We can easily remove/replace all of it.  We are trying to make driver
code consistent with the Makefiles/Kconfigs that control them.  This
means not using modular functions/macros for drivers that can never be
built as a module.  Some of the downfalls this oversight leads to are:

 (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 a lot of CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

What we see in current drivers falls into one or more of the following
categories:

1) include of  when it simply isn't needed

2) Use of MODULE_LICENSE, MODULE_DEVICE_TABLE,  MODULE_AUTHOR etc. 
   macros that are no-ops for non-modular drivers.

3) Creation of a module_exit() function that will be compiled and
   linked in but never actually called for non-modular drivers.

4) Addition of a platform_driver ".remove" function that is bound
   into the struct but will never be called for non-module use cases.

Solution to #1 --> #3 is simple ; we just delete the related code.

The solution to #4 is similar - we delete the ".remove" function and
the binding into the platform_driver struct.  However, since the same
".remove" function could also be triggered by an "unbind" (such as for
pass-through of a device to a guest instance)  - so we also explicitly
disable any unbind for the driver.

The unbind mask allows us to ensure we will see if there was some odd
corner case out there that was relying on it.  Typically it would be a
multi-port ethernet card passing a port through to a guest, so a
sensible use case in MFD drivers seems highly unlikely.  This same
solution has already been used in multiple other mainline subsystems.

Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
and ARM-64 on a recent linux-next checkout.

Paul.

---

Cc: Alessandro Rubini 
Cc: Arnd Bergmann 
Cc: Charles Keepax 
Cc: Cory Maccarrone 
Cc: Davide Ciminaghi 
Cc: Dong Aisheng 
Cc: Graeme Gregory 
Cc: Guennadi Liakhovetski 
Cc: Haojian Zhuang 
Cc: Jin Park 
Cc: Jorge Eduardo Candelaria 
Cc: Laxman Dewangan 
Cc: Lee Jones 
Cc: Linus Walleij 
Cc: Mark Brown 
Cc: Mattias Nilsson 
Cc: Michael Hennerich 
Cc: Tony Lindgren 
Cc: Venu Byravarasu 
Cc: linux-o...@vger.kernel.org
Cc: patc...@opensource.cirrus.com

Paul Gortmaker (18):
  mfd: aat2870-core: Make it explicitly non-modular
  mfd: adp5520: Make it explicitly non-modular
  mfd: as3711: Make it explicitly non-modular
  mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  mfd: htc-i2cpld: Make it explicitly non-modular
  mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  mfd: rc5t583: Make it explicitly non-modular
  mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  mfd: syscon: Make it explicitly non-modular
  mfd: tps65090: Make it explicitly non-modular
  mfd: tps65910: Make it explicitly non-modular
  mfd: tps80031: Make it explicitly non-modular
  mfd: wm831x-spi: Make it explicitly non-modular
  mfd: wm831x-i2c: Make it explicitly non-modular
  mfd: wm831x-core: drop unused module infrastructure from non-modular code
  mfd: wm8350-i2c: Make it explicitly non-modular
  mfd: wm8350-core: drop unused module infrastructure from non-modular code
  mfd: wm8400-core: Make it explicitly non-modular

 drivers/mfd/aat2870-core.c  | 40 +++-
 drivers/mfd/adp5520.c   | 30 +++---
 drivers/mfd/as3711.c| 14 --
 drivers/mfd/db8500-prcmu.c  | 10 --
 drivers/mfd/htc-i2cpld.c| 18 +-
 drivers/mfd/max8925-core.c  |  7 +--
 drivers/mfd/rc5t583.c   | 14 --
 drivers/mfd/sta2x11-mfd.c   | 10 --
 drivers/mfd/syscon.c| 12 +---
 drivers/mfd/tps65090.c  | 30 +-
 drivers/mfd/tps65910.c  | 18 +-
 drivers/mfd/tps80031.c  | 37 ++

[PATCH 06/18] mfd: max8925-core: drop unused MODULE_ tags from non-modular code

2019-01-13 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8925
drivers/mfd/Kconfig:bool "Maxim Semiconductor MAX8925 PMIC Support"

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

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

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

Cc: Lee Jones 
Cc: Haojian Zhuang 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/max8925-core.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index fd8b15cd84fd..87c724ba9793 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -10,7 +10,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -919,8 +919,3 @@ void max8925_device_exit(struct max8925_chip *chip)
free_irq(chip->tsc_irq, chip);
mfd_remove_devices(chip->dev);
 }
-
-
-MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925");
-MODULE_AUTHOR("Haojian Zhuang 

Re: [PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular

2018-12-21 Thread Paul Gortmaker
[Re: [PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular] On 
19/12/2018 (Wed 09:17) Charles Keepax wrote:

> On Mon, Dec 17, 2018 at 03:31:28PM -0500, Paul Gortmaker wrote:
> > The Kconfig currently controlling compilation of this code is:
> > 
> > drivers/mfd/Kconfig:config MFD_WM8400
> > drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8400"
> > 
> > ...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_init was not in use by this code, the init ordering
> > remains unchanged with this commit.
> > 
> > A trivial function rename from wm8400_module_init to the name
> > wm8400_driver_init is also done to reduce possible confusion.
> > 
> > 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: Lee Jones 
> > Cc: Mark Brown 
> > Cc: patc...@opensource.cirrus.com
> > Signed-off-by: Paul Gortmaker 
> > Acked-by: Linus Walleij 
> > ---
> > -MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
> >  
> >  static struct i2c_driver wm8400_i2c_driver = {
> > .driver = {
> > @@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
> >  };
> >  #endif
> 
> Do we not want to add suppress_bind_attrs into the i2c_driver
> struct here?

We can add one if you/maintainers want one, but if you look at the
original patch, this driver was using the more classic/legacy case of
subsys_init() vs. platform_driver_register() used in other drivers.

Not adding a suppress_bind_attrs here was intentional, since I'd decided
to put in the unbind entries for code that used platform_driver_register()
where the author had created the .remove code, on the assumption that they
had put some thought into the process of unbind/remove - to make it
explicit that unbind is now disabled.

To be clear, using the subsys_init() doesn't implicitly disable unbind.
However, there are lots of non-modular drivers out there; ones I've not
even touched, and to start a project to add an unbind disable to them
all is beyond the scope of the goals I've listed in the 00/18 preamble.

I'd hope maybe we can revisit the global default setting for non-modular
code someday - to make non-modules opt-in instead of opt-out, and
achieve better consistency from one driver to the next, without having
to add a new .driver sub-struct to each file for the suppress entry.

I think LinusW hinted at in an earlier email in this ongoing review,
that the default setting didn't quite make sense to him either.  But in
any case, that is a separate discussion for another time and place.

Let me know if you explicitly want one added, otherwise I'll just leave
the .remove + .suppress_bind_attrs pairing as described above.

Thanks,
Paul.
--

> 
> Thanks, Charles


[PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8350 with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
But we do delete an unused moduleparam.h

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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/wm8350-i2c.c | 24 +---
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 9358f03b7938..b4194e068e1b 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -48,30 +46,19 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
return wm8350_device_init(wm8350, i2c->irq, pdata);
 }
 
-static int wm8350_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
-
-   wm8350_device_exit(wm8350);
-
-   return 0;
-}
-
 static const struct i2c_device_id wm8350_i2c_id[] = {
{ "wm8350", 0 },
{ "wm8351", 0 },
{ "wm8352", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8350_i2c_id);
-
 
 static struct i2c_driver wm8350_i2c_driver = {
.driver = {
   .name = "wm8350",
+  .suppress_bind_attrs = true,
},
.probe = wm8350_i2c_probe,
-   .remove = wm8350_i2c_remove,
.id_table = wm8350_i2c_id,
 };
 
@@ -81,12 +68,3 @@ static int __init wm8350_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(wm8350_i2c_init);
-
-static void __exit wm8350_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm8350_i2c_exit);
-
-MODULE_DESCRIPTION("I2C support for the WM8350 AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 17/18] mfd: wm8350-core: drop unused module infrastructure from non-modular code

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350
drivers/mfd/Kconfig:bool

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Previous demodularizaion work has made wm8350_device_exit() no longer
used, so it is also removed from the 8350 core code.

Cc: Linus Walleij 
Cc: Charles Keepax 
Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8350-core.c   | 30 ++
 include/linux/mfd/wm8350/core.h |  1 -
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 8a07c5634aee..9e1070f26b11 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -442,30 +443,3 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
return ret;
 }
 EXPORT_SYMBOL_GPL(wm8350_device_init);
-
-void wm8350_device_exit(struct wm8350 *wm8350)
-{
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.led); i++)
-   platform_device_unregister(wm8350->pmic.led[i].pdev);
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++)
-   platform_device_unregister(wm8350->pmic.pdev[i]);
-
-   platform_device_unregister(wm8350->wdt.pdev);
-   platform_device_unregister(wm8350->rtc.pdev);
-   platform_device_unregister(wm8350->power.pdev);
-   platform_device_unregister(wm8350->hwmon.pdev);
-   platform_device_unregister(wm8350->gpio.pdev);
-   platform_device_unregister(wm8350->codec.pdev);
-
-   if (wm8350->irq_base)
-   free_irq(wm8350->irq_base + WM8350_IRQ_AUXADC_DATARDY, wm8350);
-
-   wm8350_irq_exit(wm8350);
-}
-EXPORT_SYMBOL_GPL(wm8350_device_exit);
-
-MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver");
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 509481d9cf19..202d9bde2c7c 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -643,7 +643,6 @@ struct wm8350_platform_data {
  */
 int wm8350_device_init(struct wm8350 *wm8350, int irq,
   struct wm8350_platform_data *pdata);
-void wm8350_device_exit(struct wm8350 *wm8350);
 
 /*
  * WM8350 device IO
-- 
2.7.4



[PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8400
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8400"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

A trivial function rename from wm8400_module_init to the name
wm8400_driver_init is also done to reduce possible confusion.

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: Lee Jones 
Cc: Mark Brown 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/wm8400-core.c | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 8a98a2fc74e1..79756c83f5f0 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -12,7 +12,7 @@
  *
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -150,7 +150,6 @@ static const struct i2c_device_id wm8400_i2c_id[] = {
{ "wm8400", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
 
 static struct i2c_driver wm8400_i2c_driver = {
.driver = {
@@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
 };
 #endif
 
-static int __init wm8400_module_init(void)
+static int __init wm8400_driver_init(void)
 {
int ret = -ENODEV;
 
@@ -173,15 +172,4 @@ static int __init wm8400_module_init(void)
 
return ret;
 }
-subsys_initcall(wm8400_module_init);
-
-static void __exit wm8400_module_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-   i2c_del_driver(_i2c_driver);
-#endif
-}
-module_exit(wm8400_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown ");
+subsys_initcall(wm8400_driver_init);
-- 
2.7.4



[PATCH v4 00/18] mfd: demodularization of non-modular drivers

2018-12-17 Thread Paul Gortmaker
[v3 --> v4: delete now unused exit fcn from wm835x core; add more acks
 now all in chrono order, re-test.]

[v2 --> v3: drop diasemi commits as they will be modularized; delete
 now unused exit fcn from wm831x core; add more acks; re-test.]

[v1 --> v2: add some more commits as requested by Lee (MFD maintainer),
 update the 00/NN text; re-do build and link testing on new linux-next. ]

This group of MFD drivers are all controlled by "bool" Kconfig settings,
but contain various amounts of largely pointless uses of infrastructure
related to modular operations, even though they can't be built modular.

We can easily remove/replace all of it.  We are trying to make driver
code consistent with the Makefiles/Kconfigs that control them.  This
means not using modular functions/macros for drivers that can never be
built as a module.  Some of the downfalls this oversight leads to are:

 (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 a lot of CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

What we see in current drivers falls into one or more of the following
categories:

1) include of  when it simply isn't needed

2) Use of MODULE_LICENSE, MODULE_DEVICE_TABLE,  MODULE_AUTHOR etc. 
   macros that are no-ops for non-modular drivers.

3) Creation of a module_exit() function that will be compiled and
   linked in but never actually called for non-modular drivers.

4) Addition of a platform_driver ".remove" function that is bound
   into the struct but will never be called for non-module use cases.

Solution to #1 --> #3 is simple ; we just delete the related code.

The solution to #4 is similar - we delete the ".remove" function and
the binding into the platform_driver struct.  However, since the same
".remove" function could also be triggered by an "unbind" (such as for
pass-through of a device to a guest instance)  - so we also explicitly
disable any unbind for the driver.

The unbind mask allows us to ensure we will see if there was some odd
corner case out there that was relying on it.  Typically it would be a
multi-port ethernet card passing a port through to a guest, so a
sensible use case in MFD drivers seems highly unlikely.  This same
solution has already been used in multiple other mainline subsystems.

Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
and ARM-64 on a recent linux-next checkout.

Paul.

---

Cc: Alessandro Rubini 
Cc: Arnd Bergmann 
Cc: Charles Keepax 
Cc: Cory Maccarrone 
Cc: Davide Ciminaghi 
Cc: Dong Aisheng 
Cc: Graeme Gregory 
Cc: Guennadi Liakhovetski 
Cc: Haojian Zhuang 
Cc: Jin Park 
Cc: Jorge Eduardo Candelaria 
Cc: Laxman Dewangan 
Cc: Lee Jones 
Cc: Linus Walleij 
Cc: Mark Brown 
Cc: Mattias Nilsson 
Cc: Michael Hennerich 
Cc: Tony Lindgren 
Cc: Venu Byravarasu 
Cc: linux-o...@vger.kernel.org
Cc: patc...@opensource.cirrus.com


Paul Gortmaker (18):
  mfd: aat2870-core: Make it explicitly non-modular
  mfd: adp5520: Make it explicitly non-modular
  mfd: as3711: Make it explicitly non-modular
  mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  mfd: htc-i2cpld: Make it explicitly non-modular
  mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  mfd: rc5t583: Make it explicitly non-modular
  mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  mfd: syscon: Make it explicitly non-modular
  mfd: tps65090: Make it explicitly non-modular
  mfd: tps65910: Make it explicitly non-modular
  mfd: tps80031: Make it explicitly non-modular
  mfd: wm831x-spi: Make it explicitly non-modular
  mfd: wm831x-i2c: Make it explicitly non-modular
  mfd: wm831x-core: drop unused module infrastructure from non-modular code
  mfd: wm8350-i2c: Make it explicitly non-modular
  mfd: wm8350-core: drop unused module infrastructure from non-modular code
  mfd: wm8400-core: Make it explicitly non-modular

 drivers/mfd/aat2870-core.c  | 40 +++-
 drivers/mfd/adp5520.c   | 30 +++---
 drivers/mfd/as3711.c| 14 --
 drivers/mfd/db8500-prcmu.c  | 10 --
 drivers/mfd/htc-i2cpld.c| 18 +-
 drivers/mfd/max8925-core.c  |  7 +--
 drivers/mfd/rc5t583.c   | 14 --
 drivers/mfd/sta2x11-mfd.c   | 10 --
 drivers/mfd/syscon.c| 12 +---
 drivers/mfd/tps65090.c  | 30 +-
 drivers/mfd/tps65910.c  | 18 +-
 drivers/mfd/tps80031.c  | 37 ++---
 drivers/mfd/wm831x-core.c   | 15 ++-
 drivers/mfd/wm831x-i2c.c|

[PATCH 11/18] mfd: tps65910: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65910
drivers/mfd/Kconfig-bool "TI TPS65910 Power Management chip"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
We do delete an unused moduleparam.h include though.

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: Tony Lindgren 
Cc: Lee Jones 
Cc: Graeme Gregory 
Cc: Jorge Eduardo Candelaria 
Cc: linux-o...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/tps65910.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf16cbe6fd88..aa3d472a10ff 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -1,5 +1,5 @@
 /*
- * tps65910.c  --  TI TPS6591x
+ * tps65910.c  --  TI TPS6591x chip family multi-function driver
  *
  * Copyright 2010 Texas Instruments Inc.
  *
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
{ },
 };
-MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
unsigned long *chip_id)
@@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
{ "tps65911", TPS65911 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
-
 
 static struct i2c_driver tps65910_i2c_driver = {
.driver = {
@@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(tps65910_i2c_init);
-
-static void __exit tps65910_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(tps65910_i2c_exit);
-
-MODULE_AUTHOR("Graeme Gregory ");
-MODULE_AUTHOR("Jorge Eduardo Candelaria ");
-MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 15/18] mfd: wm831x-core: drop unused module infrastructure from non-modular code

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X
drivers/mfd/Kconfig:bool

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

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

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

Previous demodularizaion work has made wm831x_device_exit() no longer
used, so it is also removed from the 831x core code.

Cc: Lee Jones 
Cc: Charles Keepax 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Charles Keepax 
---
 drivers/mfd/wm831x-core.c   | 15 ++-
 include/linux/mfd/wm831x/core.h |  1 -
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index e70d35ef5c6d..25fbbaf39cb9 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1892,14 +1893,6 @@ int wm831x_device_init(struct wm831x *wm831x, int irq)
return ret;
 }
 
-void wm831x_device_exit(struct wm831x *wm831x)
-{
-   wm831x_otp_exit(wm831x);
-   mfd_remove_devices(wm831x->dev);
-   free_irq(wm831x_irq(wm831x, WM831X_IRQ_AUXADC_DATA), wm831x);
-   wm831x_irq_exit(wm831x);
-}
-
 int wm831x_device_suspend(struct wm831x *wm831x)
 {
int reg, mask;
@@ -1944,7 +1937,3 @@ void wm831x_device_shutdown(struct wm831x *wm831x)
}
 }
 EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
-
-MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index b49fa67612f1..6fcb8eb00282 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -418,7 +418,6 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short 
reg,
 int count, u16 *buf);
 
 int wm831x_device_init(struct wm831x *wm831x, int irq);
-void wm831x_device_exit(struct wm831x *wm831x);
 int wm831x_device_suspend(struct wm831x *wm831x);
 void wm831x_device_shutdown(struct wm831x *wm831x);
 int wm831x_irq_init(struct wm831x *wm831x, int irq);
-- 
2.7.4



[PATCH 12/18] mfd: tps80031: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS80031
drivers/mfd/Kconfig:bool "TI TPS80031/TPS80032 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Laxman Dewangan 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/tps80031.c | 37 ++---
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index 608c7f77830e..865257ade8ac 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -516,40 +515,18 @@ static int tps80031_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps80031_remove(struct i2c_client *client)
-{
-   struct tps80031 *tps80031 = i2c_get_clientdata(client);
-   int i;
-
-   if (tps80031_power_off_dev == tps80031) {
-   tps80031_power_off_dev = NULL;
-   pm_power_off = NULL;
-   }
-
-   mfd_remove_devices(tps80031->dev);
-
-   regmap_del_irq_chip(client->irq, tps80031->irq_data);
-
-   for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
-   if (tps80031->clients[i] != client)
-   i2c_unregister_device(tps80031->clients[i]);
-   }
-   return 0;
-}
-
 static const struct i2c_device_id tps80031_id_table[] = {
{ "tps80031", TPS80031 },
{ "tps80032", TPS80032 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
 
 static struct i2c_driver tps80031_driver = {
.driver = {
-   .name   = "tps80031",
+   .name   = "tps80031",
+   .suppress_bind_attrs= true,
},
.probe  = tps80031_probe,
-   .remove = tps80031_remove,
.id_table   = tps80031_id_table,
 };
 
@@ -558,13 +535,3 @@ static int __init tps80031_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps80031_init);
-
-static void __exit tps80031_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps80031_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("TPS80031 core driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 13/18] mfd: wm831x-spi: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_SPI
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with SPI"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/wm831x-spi.c | 24 ++--
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 018ce652ae57..dd4dab419940 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,15 +67,6 @@ static int wm831x_spi_probe(struct spi_device *spi)
return wm831x_device_init(wm831x, spi->irq);
 }
 
-static int wm831x_spi_remove(struct spi_device *spi)
-{
-   struct wm831x *wm831x = spi_get_drvdata(spi);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_spi_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -108,17 +99,16 @@ static const struct spi_device_id wm831x_spi_ids[] = {
{ "wm8326", WM8326 },
{ },
 };
-MODULE_DEVICE_TABLE(spi, wm831x_spi_ids);
 
 static struct spi_driver wm831x_spi_driver = {
.driver = {
.name   = "wm831x",
.pm = _spi_pm,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.id_table   = wm831x_spi_ids,
.probe  = wm831x_spi_probe,
-   .remove = wm831x_spi_remove,
 };
 
 static int __init wm831x_spi_init(void)
@@ -132,13 +122,3 @@ static int __init wm831x_spi_init(void)
return 0;
 }
 subsys_initcall(wm831x_spi_init);
-
-static void __exit wm831x_spi_exit(void)
-{
-   spi_unregister_driver(_spi_driver);
-}
-module_exit(wm831x_spi_exit);
-
-MODULE_DESCRIPTION("SPI support for WM831x/2x AudioPlus PMICs");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
-- 
2.7.4



[PATCH 14/18] mfd: wm831x-i2c: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/wm831x-i2c.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c
index 22f7054d1b28..0f3af42f7268 100644
--- a/drivers/mfd/wm831x-i2c.c
+++ b/drivers/mfd/wm831x-i2c.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,15 +68,6 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
return wm831x_device_init(wm831x, i2c->irq);
 }
 
-static int wm831x_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm831x *wm831x = i2c_get_clientdata(i2c);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_i2c_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -103,7 +94,6 @@ static const struct i2c_device_id wm831x_i2c_id[] = {
{ "wm8326", WM8326 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
 
 static const struct dev_pm_ops wm831x_pm_ops = {
.suspend = wm831x_i2c_suspend,
@@ -115,9 +105,9 @@ static struct i2c_driver wm831x_i2c_driver = {
.name = "wm831x",
.pm = _pm_ops,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.probe = wm831x_i2c_probe,
-   .remove = wm831x_i2c_remove,
.id_table = wm831x_i2c_id,
 };
 
@@ -132,9 +122,3 @@ static int __init wm831x_i2c_init(void)
return ret;
 }
 subsys_initcall(wm831x_i2c_init);
-
-static void __exit wm831x_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm831x_i2c_exit);
-- 
2.7.4



[PATCH 09/18] mfd: syscon: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SYSCON
drivers/mfd/Kconfig:bool "System Controller Register R/W Based on Regmap"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Arnd Bergmann 
Cc: Dong Aisheng 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/syscon.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b6d05cd934e6..0ecdffb3d967 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -272,13 +272,3 @@ static int __init syscon_init(void)
return platform_driver_register(_driver);
 }
 postcore_initcall(syscon_init);
-
-static void __exit syscon_exit(void)
-{
-   platform_driver_unregister(_driver);
-}
-module_exit(syscon_exit);
-
-MODULE_AUTHOR("Dong Aisheng ");
-MODULE_DESCRIPTION("System Control driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 10/18] mfd: tps65090: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65090
drivers/mfd/Kconfig:bool "TI TPS65090 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Venu Byravarasu 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/tps65090.c | 30 +-
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index f13e4cd06e89..6968df4d7828 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -2,7 +2,9 @@
  * Core driver for TI TPS65090 PMIC family
  *
  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
-
+ *
+ * Author: Venu Byravarasu 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -171,7 +173,6 @@ static const struct of_device_id tps65090_of_match[] = {
{ .compatible = "ti,tps65090",},
{},
 };
-MODULE_DEVICE_TABLE(of, tps65090_of_match);
 #endif
 
 static int tps65090_i2c_probe(struct i2c_client *client,
@@ -236,30 +237,19 @@ static int tps65090_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps65090_i2c_remove(struct i2c_client *client)
-{
-   struct tps65090 *tps65090 = i2c_get_clientdata(client);
-
-   mfd_remove_devices(tps65090->dev);
-   if (client->irq)
-   regmap_del_irq_chip(client->irq, tps65090->irq_data);
-
-   return 0;
-}
 
 static const struct i2c_device_id tps65090_id_table[] = {
{ "tps65090", 0 },
{ },
 };
-MODULE_DEVICE_TABLE(i2c, tps65090_id_table);
 
 static struct i2c_driver tps65090_driver = {
.driver = {
.name   = "tps65090",
+   .suppress_bind_attrs = true,
.of_match_table = of_match_ptr(tps65090_of_match),
},
.probe  = tps65090_i2c_probe,
-   .remove = tps65090_i2c_remove,
.id_table   = tps65090_id_table,
 };
 
@@ -268,13 +258,3 @@ static int __init tps65090_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps65090_init);
-
-static void __exit tps65090_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps65090_exit);
-
-MODULE_DESCRIPTION("TPS65090 core driver");
-MODULE_AUTHOR("Venu Byravarasu ");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 06/18] mfd: max8925-core: drop unused MODULE_ tags from non-modular code

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8925
drivers/mfd/Kconfig:bool "Maxim Semiconductor MAX8925 PMIC Support"

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

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

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

Cc: Lee Jones 
Cc: Haojian Zhuang 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/max8925-core.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index fd8b15cd84fd..87c724ba9793 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -10,7 +10,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -919,8 +919,3 @@ void max8925_device_exit(struct max8925_chip *chip)
free_irq(chip->tsc_irq, chip);
mfd_remove_devices(chip->dev);
 }
-
-
-MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925");
-MODULE_AUTHOR("Haojian Zhuang 

[PATCH 08/18] mfd: sta2x11: drop unused MODULE_ tags from non-modular code

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_STA2X11
drivers/mfd/Kconfig:bool "STMicroelectronics STA2X11"

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

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Lee Jones 
Cc: Alessandro Rubini 
Cc: Davide Ciminaghi 
Signed-off-by: Paul Gortmaker 
Acked-by: Alessandro Rubini 
Acked-by: Davide Ciminaghi 
Acked-by: Linus Walleij 
---
 drivers/mfd/sta2x11-mfd.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 3aeafa228baf..cab9aabcaa1f 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -1,4 +1,6 @@
 /*
+ * STA2x11 mfd for GPIO, SCTL and APBREG
+ *
  * Copyright (c) 2009-2011 Wind River Systems, Inc.
  * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini, Davide Ciminaghi)
  *
@@ -18,7 +20,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -653,8 +656,3 @@ static int __init sta2x11_mfd_init(void)
  */
 subsys_initcall(sta2x11_drivers_init);
 rootfs_initcall(sta2x11_mfd_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wind River");
-MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
-MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);
-- 
2.7.4



[PATCH 03/18] mfd: as3711: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:bool "AMS AS3711"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Guennadi Liakhovetski 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/as3711.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 67b12417585d..7a74a874b93c 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -118,7 +117,6 @@ static const struct of_device_id as3711_of_match[] = {
{.compatible = "ams,as3711",},
{}
 };
-MODULE_DEVICE_TABLE(of, as3711_of_match);
 #endif
 
 static int as3711_i2c_probe(struct i2c_client *client,
@@ -202,8 +200,6 @@ static const struct i2c_device_id as3711_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
-
 static struct i2c_driver as3711_i2c_driver = {
.driver = {
   .name = "as3711",
@@ -219,13 +215,3 @@ static int __init as3711_i2c_init(void)
 }
 /* Initialise early */
 subsys_initcall(as3711_i2c_init);
-
-static void __exit as3711_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(as3711_i2c_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski ");
-MODULE_DESCRIPTION("AS3711 PMIC driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 07/18] mfd: rc5t583: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_RC5T583
drivers/mfd/Kconfig:bool "Ricoh RC5T583 Power Management system device"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Laxman Dewangan 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/rc5t583.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index fd46de02b715..c5cc5cb3dde7 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -298,8 +297,6 @@ static const struct i2c_device_id rc5t583_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
-
 static struct i2c_driver rc5t583_i2c_driver = {
.driver = {
   .name = "rc5t583",
@@ -313,14 +310,3 @@ static int __init rc5t583_i2c_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(rc5t583_i2c_init);
-
-static void __exit rc5t583_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-
-module_exit(rc5t583_i2c_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("RICOH RC5T583 power management system device driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 05/18] mfd: htc-i2cpld: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig for this option is currently:

config HTC_I2CPLD
bool "HTC I2C PLD chip 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_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: Cory Maccarrone 
Cc: Lee Jones 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/htc-i2cpld.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 01572b5e79e8..af3c66355270 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -27,7 +27,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -614,8 +613,6 @@ static const struct i2c_device_id htcpld_chip_id[] = {
{ "htcpld-chip", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, htcpld_chip_id);
-
 
 static struct i2c_driver htcpld_chip_driver = {
.driver = {
@@ -643,17 +640,4 @@ static int __init htcpld_core_init(void)
/* Probe for our chips */
return platform_driver_probe(_core_driver, htcpld_core_probe);
 }
-
-static void __exit htcpld_core_exit(void)
-{
-   i2c_del_driver(_chip_driver);
-   platform_driver_unregister(_core_driver);
-}
-
-module_init(htcpld_core_init);
-module_exit(htcpld_core_exit);
-
-MODULE_AUTHOR("Cory Maccarrone ");
-MODULE_DESCRIPTION("I2C HTC PLD Driver");
-MODULE_LICENSE("GPL");
-
+device_initcall(htcpld_core_init);
-- 
2.7.4



[PATCH 04/18] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
drivers/mfd/Kconfig:bool "ST-Ericsson DB8500 Power Reset Control Management 
Unit"

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: Mattias Nilsson 
Signed-off-by: Paul Gortmaker 
Reviewed-by: Linus Walleij 
---
 drivers/mfd/db8500-prcmu.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index aec20e1c7d3d..65666b624ae8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1,4 +1,6 @@
 /*
+ * DB8500 PRCM Unit driver
+ *
  * Copyright (C) STMicroelectronics 2009
  * Copyright (C) ST-Ericsson SA 2010
  *
@@ -10,7 +12,8 @@
  * U8500 PRCM Unit interface driver
  *
  */
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -3188,9 +3191,4 @@ static int __init db8500_prcmu_init(void)
 {
return platform_driver_register(_prcmu_driver);
 }
-
 core_initcall(db8500_prcmu_init);
-
-MODULE_AUTHOR("Mattias Nilsson ");
-MODULE_DESCRIPTION("DB8500 PRCM Unit driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 02/18] mfd: adp5520: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Makefile/Kconfig currently controlling compilation of this code is:

drivers/mfd/Makefile:obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
drivers/mfd/Kconfig:config PMIC_ADP5520
drivers/mfd/Kconfig:bool "Analog Devices ADP5520/01 MFD PMIC Core 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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

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
was (or is now) contained at the top of the file in the comments.

Cc: Michael Hennerich 
Cc: Lee Jones 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/adp5520.c | 30 +++---
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index be0497b96720..2cdd39cb8a18 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -7,6 +7,8 @@
  *
  * Copyright 2009 Analog Devices Inc.
  *
+ * Author: Michael Hennerich 
+ *
  * Derived from da903x:
  * Copyright (C) 2008 Compulab, Ltd.
  * Mike Rapoport 
@@ -18,7 +20,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -304,18 +306,6 @@ static int adp5520_probe(struct i2c_client *client,
return ret;
 }
 
-static int adp5520_remove(struct i2c_client *client)
-{
-   struct adp5520_chip *chip = dev_get_drvdata(>dev);
-
-   if (chip->irq)
-   free_irq(chip->irq, chip);
-
-   adp5520_remove_subdevs(chip);
-   adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
@@ -346,20 +336,14 @@ static const struct i2c_device_id adp5520_id[] = {
{ "pmic-adp5501", ID_ADP5501 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, adp5520_id);
 
 static struct i2c_driver adp5520_driver = {
.driver = {
-   .name   = "adp5520",
-   .pm = _pm,
+   .name   = "adp5520",
+   .pm = _pm,
+   .suppress_bind_attrs= true,
},
.probe  = adp5520_probe,
-   .remove = adp5520_remove,
.id_table   = adp5520_id,
 };
-
-module_i2c_driver(adp5520_driver);
-
-MODULE_AUTHOR("Michael Hennerich ");
-MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(adp5520_driver);
-- 
2.7.4



[PATCH 01/18] mfd: aat2870-core: Make it explicitly non-modular

2018-12-17 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AAT2870_CORE
drivers/mfd/Kconfig:bool "AnalogicTech AAT2870"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Jin Park 
Signed-off-by: Paul Gortmaker 
Acked-by: Linus Walleij 
---
 drivers/mfd/aat2870-core.c | 40 +++-
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 3ba19a45f199..9d3d90d386c2 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -20,7 +20,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -349,18 +348,10 @@ static void aat2870_init_debugfs(struct aat2870_data 
*aat2870)
 "Failed to create debugfs register file\n");
 }
 
-static void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-   debugfs_remove_recursive(aat2870->dentry_root);
-}
 #else
 static inline void aat2870_init_debugfs(struct aat2870_data *aat2870)
 {
 }
-
-static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-}
 #endif /* CONFIG_DEBUG_FS */
 
 static int aat2870_i2c_probe(struct i2c_client *client,
@@ -440,20 +431,6 @@ static int aat2870_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int aat2870_i2c_remove(struct i2c_client *client)
-{
-   struct aat2870_data *aat2870 = i2c_get_clientdata(client);
-
-   aat2870_uninit_debugfs(aat2870);
-
-   mfd_remove_devices(aat2870->dev);
-   aat2870_disable(aat2870);
-   if (aat2870->uninit)
-   aat2870->uninit(aat2870);
-
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
@@ -492,15 +469,14 @@ static const struct i2c_device_id aat2870_i2c_id_table[] 
= {
{ "aat2870", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table);
 
 static struct i2c_driver aat2870_i2c_driver = {
.driver = {
-   .name   = "aat2870",
-   .pm = _pm_ops,
+   .name   = "aat2870",
+   .pm = _pm_ops,
+   .suppress_bind_attrs= true,
},
.probe  = aat2870_i2c_probe,
-   .remove = aat2870_i2c_remove,
.id_table   = aat2870_i2c_id_table,
 };
 
@@ -509,13 +485,3 @@ static int __init aat2870_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(aat2870_init);
-
-static void __exit aat2870_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(aat2870_exit);
-
-MODULE_DESCRIPTION("Core support for the AnalogicTech AAT2870");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jin Park ");
-- 
2.7.4



Re: [Regression 4.15] Can't kill CONFIG_UNWINDER_ORC with fire or plague.

2018-12-16 Thread Paul Gortmaker
[Re: [Regression 4.15] Can't kill CONFIG_UNWINDER_ORC with fire or plague.] On 
29/12/2017 (Fri 13:18) Paul Gortmaker wrote:

> [Re: [Regression 4.15] Can't kill CONFIG_UNWINDER_ORC with fire or plague.] 
> On 29/12/2017 (Fri 10:47) Josh Poimboeuf wrote:
> 
> > This seems to be related to a kconfig quirk where only silentoldconfig
> > updates the include/config/auto.conf file.  The other config targets
> > (oldconfig, defconfig, etc) don't touch it.  It seems intentional, but I
> > have no idea why.
> > 
> > That causes the Makefile to get stale data for 'CONFIG_*' variables when
> > it includes auto.conf.  So I don't think this is specific to the ORC
> > check.  It seems like it could also cause bugs elsewhere.
> 
> OK, good - you agree with my initial diagnosis of stale auto.conf then.
> Not sure what Randy was testing when he said he couldn't reproduce it.
> 
> > The below (ugly) patch fixes it, though I'm not sure this is the best
> > way to do it.  We probably need Masahiro or Michal to chime in here.
> 
> Yep, that is why I intentionally put the kbuild folks on the To/Cc of
> the original report (and ran away screaming at the prospect of debugging
> Makefiles on xmas day).  But with holidays and all, it might not be
> until early January before they have a chance to reply.

It is nearly a year later and we still have this false positive.

paul@sm:~/git/linux-head$ make -j12 > /dev/null
Makefile:966: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
 please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
paul@sm:~/git/linux-head$ grep UNWINDER_ORC .config
# CONFIG_UNWINDER_ORC is not set

We do know a bit more now -- the auto.conf issue has been independently
confirmed and "fixed" for other subsystems/issues since, like RETPOLINE:

 -
  commit 25896d073d8a0403b07e6dec56f58e6c33678207
  Author: Masahiro Yamada 
  Date:   Wed Dec 5 15:27:19 2018 +0900
   
x86/build: Fix compiler support check for CONFIG_RETPOLINE

It is troublesome to add a diagnostic like this to the Makefile
parse stage because the top-level Makefile could be parsed with
a stale include/config/auto.conf.

Once you are hit by the error about non-retpoline compiler, the
compilation still breaks even after disabling CONFIG_RETPOLINE.
 -

I'm not sure if we want to treat this on a per config option each time
again and again, or undertake a more global kbuild approach, but it does
warrant a mention and a re-examination before we "solve" this again.

Paul.
--


Re: linux-next: Tree for Dec 14 (security/integrity/ima/)

2018-12-14 Thread Paul Gortmaker
[Re: linux-next: Tree for Dec 14 (security/integrity/ima/)] On 14/12/2018 (Fri 
15:26) Paul Gortmaker wrote:

> [Re: linux-next: Tree for Dec 14 (security/integrity/ima/)] On 14/12/2018 
> (Fri 14:19) Mimi Zohar wrote:
> 
> > On Fri, 2018-12-14 at 08:25 -0800, Randy Dunlap wrote:
> > > 
> > > on i386:
> > > 
> > >   CC  security/integrity/ima/ima_main.o
> > > ../security/integrity/ima/ima_main.c: In function 'ima_load_data':
> > > ../security/integrity/ima/ima_main.c:535:3: error: implicit declaration 
> > > of function 'is_module_sig_enforced' 
> > > [-Werror=implicit-function-declaration]
> > >sig_enforce = is_module_sig_enforced();
> > >^

[...]

> > Commit 4f83d5ea643a ("security: integrity: make ima_main explicitly
> > non-modular") just removed module.h.
> 
> Yes, unfortunately the security directory has additional confusion
> because there is name space overlap between "module" as used in Linux
> Security Module, and "module" as in "insmod foo.ko".  The ima_main
> is not modular, but it does use modular infrastructure to load others.
> 
> Fortunately this was the final commit in the series, so it can be
> removed or reverted as per maintainer's choice.  In the meantime, I'll
> look into why my "allyesconfig" build testing didn't pick up on this,
> so I can close that testing gap.

I've confirmed that most .config result in an implicit header presence
by looking at the CPP output.  Details below.

James, if your input branch to linux-next is strictly fast forward, here
is a partial revert to fix up what Randy found that you can apply.

Thanks for the report, and again - sorry for not detecting this myself.
Paul.
--

>From 31081a8b46e84d64e2fbda8d0d82ba26d56cc468 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker 
Date: Fri, 14 Dec 2018 16:48:07 -0500
Subject: [PATCH] security: integrity: partial revert of make ima_main
 explicitly non-modular

In commit 4f83d5ea643a ("security: integrity: make ima_main explicitly
non-modular") I'd removed  after assuming that the
function is_module_sig_enforced() was an LSM function and not a core
kernel module function.

Unfortunately the typical .config selections used in build testing
provide an implicit  presence, and so normal/typical
build testing did not immediately reveal my incorrect assumption.

Cc: Mimi Zohar 
Cc: Dmitry Kasatkin 
Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: linux-ima-de...@lists.sourceforge.net
Cc: linux-security-mod...@vger.kernel.org
Reported-by: Randy Dunlap 
Signed-off-by: Paul Gortmaker 

diff --git a/security/integrity/ima/ima_main.c 
b/security/integrity/ima/ima_main.c
index adaf96932237..616a88f95b92 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -21,7 +21,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
+#include 
 #include 
 #include 
 #include 
-- 
2.7.4



Re: linux-next: Tree for Dec 14 (security/integrity/ima/)

2018-12-14 Thread Paul Gortmaker
[Re: linux-next: Tree for Dec 14 (security/integrity/ima/)] On 14/12/2018 (Fri 
14:19) Mimi Zohar wrote:

> [Cc'ing Paul Gortmaker]
> 
> On Fri, 2018-12-14 at 08:25 -0800, Randy Dunlap wrote:
> > On 12/13/18 11:18 PM, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > Changes since 20181213:
> > > 
> > 
> > on i386:
> > 
> >   CC  security/integrity/ima/ima_main.o
> > ../security/integrity/ima/ima_main.c: In function 'ima_load_data':
> > ../security/integrity/ima/ima_main.c:535:3: error: implicit declaration of 
> > function 'is_module_sig_enforced' [-Werror=implicit-function-declaration]
> >sig_enforce = is_module_sig_enforced();
> >^
> > 
> > 
> > Needs:
> 
> Commit 4f83d5ea643a ("security: integrity: make ima_main explicitly
> non-modular") just removed module.h.

Yes, unfortunately the security directory has additional confusion
because there is name space overlap between "module" as used in Linux
Security Module, and "module" as in "insmod foo.ko".  The ima_main
is not modular, but it does use modular infrastructure to load others.

Fortunately this was the final commit in the series, so it can be
removed or reverted as per maintainer's choice.  In the meantime, I'll
look into why my "allyesconfig" build testing didn't pick up on this,
so I can close that testing gap.

Randy, if you were using one of your usual "randconfig" builds, maybe
you can mail me the .config out of band - no need spamming the lists.

Thanks, and sorry for the undetected fallout.
Paul.
--

> 
> Mimi 
> 
> 
> > 
> > ---
> >  security/integrity/ima/ima_main.c |1 +
> >  1 file changed, 1 insertion(+)
> > 
> > --- linux-next-20181214.orig/security/integrity/ima/ima_main.c
> > +++ linux-next-20181214/security/integrity/ima/ima_main.c
> > @@ -24,6 +24,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > 
> > 
> > 
> 


Re: [PATCH 17/18] mfd: wm8350-core: drop unused MODULE_ tags from non-modular code

2018-12-10 Thread Paul Gortmaker
[Re: [PATCH 17/18] mfd: wm8350-core: drop unused MODULE_ tags from non-modular 
code] On 10/12/2018 (Mon 06:38) Lee Jones wrote:

> On Fri, 07 Dec 2018, Paul Gortmaker wrote:

[...]

> > Cc: Linus Walleij 
> > Cc: Lee Jones 
> > Cc: patc...@opensource.cirrus.com
> > Acked-by: Linus Walleij 
> > Signed-off-by: Paul Gortmaker 
> 
> When you submit this patch again (collecting more Acks or
> what-have-you), please re-order your tags chronologically.

Thanks. Will do.  Here is v3 --> v3a ; adding the orphan function
removal rightfully requested by Charles.  With an ack or two on this,
I will send a v4 with all Acks and in order after SOB, and hopefully
we are done here, and can avoid a v5 of this series.

Thanks for your patience everyone.
Paul.
--


>From 477ed697823f61974bdea5678e6ce225cf9b Mon Sep 17 00:00:00 2001
From: Paul Gortmaker 
Date: Wed, 6 Jul 2016 16:46:39 -0400
Subject: [PATCH] mfd: wm8350-core: drop unused module infrastructure from
 non-modular code

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350
drivers/mfd/Kconfig:bool

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Previous demodularizaion work has made wm8350_device_exit() no longer
used, so it is also removed from the 8350 core code.

Cc: Linus Walleij 
Cc: Charles Keepax 
Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 8a07c5634aee..9e1070f26b11 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -442,30 +443,3 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
return ret;
 }
 EXPORT_SYMBOL_GPL(wm8350_device_init);
-
-void wm8350_device_exit(struct wm8350 *wm8350)
-{
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.led); i++)
-   platform_device_unregister(wm8350->pmic.led[i].pdev);
-
-   for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++)
-   platform_device_unregister(wm8350->pmic.pdev[i]);
-
-   platform_device_unregister(wm8350->wdt.pdev);
-   platform_device_unregister(wm8350->rtc.pdev);
-   platform_device_unregister(wm8350->power.pdev);
-   platform_device_unregister(wm8350->hwmon.pdev);
-   platform_device_unregister(wm8350->gpio.pdev);
-   platform_device_unregister(wm8350->codec.pdev);
-
-   if (wm8350->irq_base)
-   free_irq(wm8350->irq_base + WM8350_IRQ_AUXADC_DATARDY, wm8350);
-
-   wm8350_irq_exit(wm8350);
-}
-EXPORT_SYMBOL_GPL(wm8350_device_exit);
-
-MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver");
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 509481d9cf19..202d9bde2c7c 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -643,7 +643,6 @@ struct wm8350_platform_data {
  */
 int wm8350_device_init(struct wm8350 *wm8350, int irq,
   struct wm8350_platform_data *pdata);
-void wm8350_device_exit(struct wm8350 *wm8350);
 
 /*
  * WM8350 device IO
-- 
2.7.4



Re: [PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular

2018-12-10 Thread Paul Gortmaker
[Re: [PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular] On 
10/12/2018 (Mon 09:28) Charles Keepax wrote:

> On Fri, Dec 07, 2018 at 03:11:03PM -0500, Paul Gortmaker wrote:

[...]

> > -static int wm8350_i2c_remove(struct i2c_client *i2c)
> > -{
> > -   struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
> > -
> > -   wm8350_device_exit(wm8350);
> 
> This is the only caller of this function so you probably want to
> remove it in the next patch as we did for the 831x stuff.

Thanks - I should have caught this instance after you pointed me at
the 831x version of the same issue.  But I did not.  :-(

I'll follow up the 17/18 wm8350-core patch with the wm8350_device_exit
delete added ; maybe if you can Ack that and hence the unchanged
wm8350-i2c patch shown here - then we can avoid me spamming Lee and
everyone else with 20-odd patches in v5 just to add acks to a v4 - vs.
hopefully having a v4 being final.

Linus - I'd removed your Ack from 831x-core and this pending 8350-core
update, since the original patch you ack'd has since changed to delete
an orphaned function.  I would of course add them back if you are OK
with the updated versions and put them in the v4, but I did not want to
assume that.

Acks will all be after SOB lines as requested by Lee in the v4 as well.

Thanks,
Paul.
--

> 
> Thanks, Charles


[PATCH 2/3] phy: make phy-mvebu-sata explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/phy/Kconfig:config PHY_MVEBU_SATA
drivers/phy/Kconfig:def_bool y

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

Lets remove the couple of traces of modular infrastructure, 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: Kishon Vijay Abraham I 
Cc: Andrew Lunn 
Signed-off-by: Paul Gortmaker 
---
 drivers/phy/marvell/phy-mvebu-sata.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-sata.c 
b/drivers/phy/marvell/phy-mvebu-sata.c
index 768ce92e81ce..369fece2be7a 100644
--- a/drivers/phy/marvell/phy-mvebu-sata.c
+++ b/drivers/phy/marvell/phy-mvebu-sata.c
@@ -10,7 +10,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -122,7 +122,6 @@ static const struct of_device_id phy_mvebu_sata_of_match[] 
= {
{ .compatible = "marvell,mvebu-sata-phy" },
{ },
 };
-MODULE_DEVICE_TABLE(of, phy_mvebu_sata_of_match);
 
 static struct platform_driver phy_mvebu_sata_driver = {
.probe  = phy_mvebu_sata_probe,
@@ -131,8 +130,4 @@ static struct platform_driver phy_mvebu_sata_driver = {
.of_match_table = phy_mvebu_sata_of_match,
}
 };
-module_platform_driver(phy_mvebu_sata_driver);
-
-MODULE_AUTHOR("Andrew Lunn ");
-MODULE_DESCRIPTION("Marvell MVEBU SATA PHY driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(phy_mvebu_sata_driver);
-- 
2.7.4



[PATCH 3/3] phy: make phy-armada375-usb2 explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/phy/marvell/Kconfig:config ARMADA375_USBCLUSTER_PHY
drivers/phy/marvell/Kconfig:def_bool y

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

Lets remove the couple of traces of modular infrastructure, 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: Kishon Vijay Abraham I 
Cc: Gregory CLEMENT 
Signed-off-by: Paul Gortmaker 
---
 drivers/phy/marvell/phy-armada375-usb2.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/phy/marvell/phy-armada375-usb2.c 
b/drivers/phy/marvell/phy-armada375-usb2.c
index 1a3db288c0a9..4f0295992500 100644
--- a/drivers/phy/marvell/phy-armada375-usb2.c
+++ b/drivers/phy/marvell/phy-armada375-usb2.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -142,7 +141,6 @@ static const struct of_device_id of_usb_cluster_table[] = {
{ .compatible = "marvell,armada-375-usb-cluster", },
{ /* end of list */ },
 };
-MODULE_DEVICE_TABLE(of, of_usb_cluster_table);
 
 static struct platform_driver armada375_usb_phy_driver = {
.probe  = armada375_usb_phy_probe,
@@ -151,8 +149,4 @@ static struct platform_driver armada375_usb_phy_driver = {
.name  = "armada-375-usb-cluster",
}
 };
-module_platform_driver(armada375_usb_phy_driver);
-
-MODULE_DESCRIPTION("Armada 375 USB cluster driver");
-MODULE_AUTHOR("Gregory CLEMENT ");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(armada375_usb_phy_driver);
-- 
2.7.4



[PATCH 0/3] phy: remove needless usage of module header

2018-12-09 Thread Paul Gortmaker
The most important thing to note here, is these clean-ups make no
changes to the final generated run-time.  The 1st commit removes an
unused function, otherwise the generated objects are also unchanged.

The work here represents a scan over the phy dir, looking for files
that have nothing to do with a modular use case, but are using modular
infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs
that control them.  This means not using modular functions/macros for
drivers that can never be built as a module.  This has been done in quite
a lot of other mainline subsystem dirs already.

Using modular infrastructure in non-modules might seem harmless, but some
of the downfalls this leads to are:

 (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 drivers and spreads quickly.

As a data point for #3 above, an empty C file that just includes the
module.h header generates over 750kB of CPP output.  Repeating the same
experiment with init.h and the result is less than 12kB; with export.h
it is only about 1/2kB; with both it still is less than 12kB.

Build tested on x86-64 and ARM-64.

Paul.
---

Cc: Andrew Lunn 
Cc: Gregory CLEMENT 
Cc: Kishon Vijay Abraham I 

Paul Gortmaker (3):
  phy: make phy-core explicitly non-modular
  phy: make phy-mvebu-sata explicitly non-modular
  phy: make phy-armada375-usb2 explicitly non-modular

 drivers/phy/marvell/phy-armada375-usb2.c |  8 +---
 drivers/phy/marvell/phy-mvebu-sata.c |  9 ++---
 drivers/phy/phy-core.c   | 12 +---
 3 files changed, 4 insertions(+), 25 deletions(-)

-- 
2.7.4



[PATCH 1/3] phy: make phy-core explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/phy/Kconfig:config GENERIC_PHY
drivers/phy/Kconfig:bool "PHY Core"

...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_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't remove module.h since the file is using other modular fcns
(to load other phy modules) even though the core support itself is
non-modular.

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: Kishon Vijay Abraham I 
Signed-off-by: Paul Gortmaker 
---
 drivers/phy/phy-core.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index df3d4ba516ab..f10110676572 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -1048,14 +1048,4 @@ static int __init phy_core_init(void)
 
return 0;
 }
-module_init(phy_core_init);
-
-static void __exit phy_core_exit(void)
-{
-   class_destroy(phy_class);
-}
-module_exit(phy_core_exit);
-
-MODULE_DESCRIPTION("Generic PHY Framework");
-MODULE_AUTHOR("Kishon Vijay Abraham I ");
-MODULE_LICENSE("GPL v2");
+device_initcall(phy_core_init);
-- 
2.7.4



[PATCH 2/5] keys: remove needless modular infrastructure from ecryptfs_format

2018-12-09 Thread Paul Gortmaker
Even though the support can be modular, only one file needs to use
all the macros like MODULE_AUTHOR, MODULE_LICENSE etc.  Only the one
responsible for registering/removal with module_init/module_exit
needs to declare these.  In this case, that file is "encrypted.c"
and it already has the MODULE_LICENSE that we are removing here.

Since the file does EXPORT_SYMBOL, we add export.h - and build tests
show that module.h (which includes everything) was hiding an implicit
use of string.h - so that is added as well.

Cc: Mimi Zohar 
Cc: David Howells 
Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: linux-integr...@vger.kernel.org
Cc: keyri...@vger.kernel.org
Cc: linux-security-mod...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 security/keys/encrypted-keys/ecryptfs_format.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/security/keys/encrypted-keys/ecryptfs_format.c 
b/security/keys/encrypted-keys/ecryptfs_format.c
index 6daa3b6ff9ed..efac03047919 100644
--- a/security/keys/encrypted-keys/ecryptfs_format.c
+++ b/security/keys/encrypted-keys/ecryptfs_format.c
@@ -15,7 +15,8 @@
  * the Free Software Foundation, version 2 of the License.
  */
 
-#include 
+#include 
+#include 
 #include "ecryptfs_format.h"
 
 u8 *ecryptfs_get_auth_tok_key(struct ecryptfs_auth_tok *auth_tok)
@@ -77,5 +78,3 @@ int ecryptfs_fill_auth_tok(struct ecryptfs_auth_tok *auth_tok,
return 0;
 }
 EXPORT_SYMBOL(ecryptfs_fill_auth_tok);
-
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 5/5] security: integrity: make ima_main explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Makefile/Kconfig entry controlling compilation of this code is:

obj-$(CONFIG_IMA) += ima.o
ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
 ima_policy.o ima_template.o ima_template_lib.o

security/integrity/ima/Kconfig:config IMA
security/integrity/ima/Kconfig- bool "Integrity Measurement Architecture(IMA)"

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

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

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: Mimi Zohar 
Cc: Dmitry Kasatkin 
Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: linux-ima-de...@lists.sourceforge.net
Cc: linux-security-mod...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 security/integrity/ima/ima_main.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/security/integrity/ima/ima_main.c 
b/security/integrity/ima/ima_main.c
index 1b88d58e1325..adaf96932237 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -1,4 +1,6 @@
 /*
+ * Integrity Measurement Architecture
+ *
  * Copyright (C) 2005,2006,2007,2008 IBM Corporation
  *
  * Authors:
@@ -19,7 +21,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -560,6 +562,3 @@ static int __init init_ima(void)
 }
 
 late_initcall(init_ima);   /* Start IMA after the TPM is available */
-
-MODULE_DESCRIPTION("Integrity Measurement Architecture");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 4/5] security: integrity: make evm_main explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Makefile/Kconfig entry controlling compilation of this code is:

obj-$(CONFIG_EVM) += evm.o
evm-y := evm_main.o evm_crypto.o evm_secfs.o

security/integrity/evm/Kconfig:config EVM
security/integrity/evm/Kconfig: bool "EVM support"

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

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

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: Mimi Zohar 
Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: linux-ima-de...@lists.sourceforge.net
Cc: linux-security-mod...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 security/integrity/evm/evm_main.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/security/integrity/evm/evm_main.c 
b/security/integrity/evm/evm_main.c
index 7f3f54d89a6e..5ecaa3d6fe0b 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -16,7 +16,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -592,6 +592,3 @@ static int __init init_evm(void)
 }
 
 late_initcall(init_evm);
-
-MODULE_DESCRIPTION("Extended Verification Module");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 3/5] security: fs: make inode explicitly non-modular

2018-12-09 Thread Paul Gortmaker
The Makefile/Kconfig entry controlling compilation of this code is:

security/Makefile:obj-$(CONFIG_SECURITYFS)+= inode.o

security/Kconfig:config SECURITYFS
security/Kconfig:   bool "Enable the securityfs filesystem"

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

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

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

The removal of module.h uncovered a couple previously hidden implicit
header requirements which are now included explicitly.

Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: linux-security-mod...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 security/inode.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/security/inode.c b/security/inode.c
index 8dd9ca8848e4..b7772a9b315e 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -13,7 +13,8 @@
  */
 
 /* #define DEBUG */
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -341,7 +342,4 @@ static int __init securityfs_init(void)
 #endif
return 0;
 }
-
 core_initcall(securityfs_init);
-MODULE_LICENSE("GPL");
-
-- 
2.7.4



[PATCH 0/5] security: remove needless usage of module header

2018-12-09 Thread Paul Gortmaker
The most important thing to note here, is these clean-ups make no
changes to the object files or the final generated run-time.

The work here represents a scan over the security dir, looking for files
that have nothing to do with a modular use case, but are using modular
infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs
that control them.  This means not using modular functions/macros for
drivers that can never be built as a module.  This has been done in quite
a lot of other mainline subsystem dirs already.

Using modular infrastructure in non-modules might seem harmless, but some
of the downfalls this leads to are:

 (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 drivers and spreads quickly.

As a data point for #3 above, an empty C file that just includes the
module.h header generates over 750kB of CPP output.  Repeating the same
experiment with init.h and the result is less than 12kB; with export.h
it is only about 1/2kB; with both it still is less than 12kB.

We start with the simple ones - removing  from where
it simply isn't required.  Then we remove the no-op MODULE_ macros from
non-modular files, in order to remove module.h from there as well.
Overall, we get rid of about 28 instances of  here.

Build tested on v4.20-rc5 for allmodconfig on x86-64 and ARM-64.

Paul.
---

Cc: David Howells 
Cc: Dmitry Kasatkin 
Cc: James Morris 
Cc: John Johansen 
Cc: Mimi Zohar 
Cc: "Serge E. Hallyn" 
Cc: keyri...@vger.kernel.org
Cc: linux-ima-de...@lists.sourceforge.net
Cc: linux-integr...@vger.kernel.org
Cc: linux-security-mod...@vger.kernel.org

Paul Gortmaker (5):
  security: audit and remove any unnecessary uses of module.h
  keys: remove needless modular infrastructure from ecryptfs_format
  security: fs: make inode explicitly non-modular
  security: integrity: make evm_main explicitly non-modular
  security: integrity: make ima_main explicitly non-modular

 security/apparmor/apparmorfs.c   | 2 +-
 security/commoncap.c | 1 -
 security/inode.c | 6 ++
 security/integrity/evm/evm_crypto.c  | 2 +-
 security/integrity/evm/evm_main.c| 5 +
 security/integrity/evm/evm_posix_acl.c   | 1 -
 security/integrity/evm/evm_secfs.c   | 2 +-
 security/integrity/iint.c| 2 +-
 security/integrity/ima/ima_api.c | 1 -
 security/integrity/ima/ima_appraise.c| 2 +-
 security/integrity/ima/ima_fs.c  | 2 +-
 security/integrity/ima/ima_init.c| 2 +-
 security/integrity/ima/ima_main.c| 7 +++
 security/integrity/ima/ima_policy.c  | 2 +-
 security/integrity/ima/ima_queue.c   | 1 -
 security/keys/encrypted-keys/ecryptfs_format.c   | 5 ++---
 security/keys/encrypted-keys/masterkey_trusted.c | 1 -
 security/keys/gc.c   | 1 -
 security/keys/key.c  | 2 +-
 security/keys/keyctl.c   | 1 -
 security/keys/keyring.c  | 2 +-
 security/keys/permission.c   | 2 +-
 security/keys/proc.c | 1 -
 security/keys/process_keys.c | 1 -
 security/keys/request_key.c  | 2 +-
 security/keys/request_key_auth.c | 1 -
 security/keys/user_defined.c | 2 +-
 security/security.c  | 2 +-
 28 files changed, 22 insertions(+), 39 deletions(-)

-- 
2.7.4



[PATCH 1/5] security: audit and remove any unnecessary uses of module.h

2018-12-09 Thread Paul Gortmaker
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

Cc: James Morris 
Cc: "Serge E. Hallyn" 
Cc: John Johansen 
Cc: Mimi Zohar 
Cc: Dmitry Kasatkin 
Cc: David Howells 
Cc: linux-security-mod...@vger.kernel.org
Cc: linux-integr...@vger.kernel.org
Cc: keyri...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 security/apparmor/apparmorfs.c   | 2 +-
 security/commoncap.c | 1 -
 security/integrity/evm/evm_crypto.c  | 2 +-
 security/integrity/evm/evm_posix_acl.c   | 1 -
 security/integrity/evm/evm_secfs.c   | 2 +-
 security/integrity/iint.c| 2 +-
 security/integrity/ima/ima_api.c | 1 -
 security/integrity/ima/ima_appraise.c| 2 +-
 security/integrity/ima/ima_fs.c  | 2 +-
 security/integrity/ima/ima_init.c| 2 +-
 security/integrity/ima/ima_policy.c  | 2 +-
 security/integrity/ima/ima_queue.c   | 1 -
 security/keys/encrypted-keys/masterkey_trusted.c | 1 -
 security/keys/gc.c   | 1 -
 security/keys/key.c  | 2 +-
 security/keys/keyctl.c   | 1 -
 security/keys/keyring.c  | 2 +-
 security/keys/permission.c   | 2 +-
 security/keys/proc.c | 1 -
 security/keys/process_keys.c | 1 -
 security/keys/request_key.c  | 2 +-
 security/keys/request_key_auth.c | 1 -
 security/keys/user_defined.c | 2 +-
 security/security.c  | 2 +-
 24 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 8963203319ea..3f80a684c232 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/security/commoncap.c b/security/commoncap.c
index 18a4fdf6f6eb..232db019f051 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -9,7 +9,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/security/integrity/evm/evm_crypto.c 
b/security/integrity/evm/evm_crypto.c
index 8c25f949ebdb..77ef210a8a6b 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -15,7 +15,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/security/integrity/evm/evm_posix_acl.c 
b/security/integrity/evm/evm_posix_acl.c
index 46408b9e62e8..7faf98c20373 100644
--- a/security/integrity/evm/evm_posix_acl.c
+++ b/security/integrity/evm/evm_posix_acl.c
@@ -9,7 +9,6 @@
  * the Free Software Foundation, version 2 of the License.
  */
 
-#include 
 #include 
 #include 
 
diff --git a/security/integrity/evm/evm_secfs.c 
b/security/integrity/evm/evm_secfs.c
index 77de71b7794c..015aea8fdf1e 100644
--- a/security/integrity/evm/evm_secfs.c
+++ b/security/integrity/evm/evm_secfs.c
@@ -17,7 +17,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include "evm.h"
 
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1ea05da2323d..88f04b3380d4 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -16,7 +16,7 @@
  *   using a rbtree tree.
  */
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index 99dd1d53fc35..67dfbd1af3ca 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -12,7 +12,6 @@
  * Implements must_appraise_or_measure, collect_measurement,
  * appraise_measurement, store_measurement and store_template.
  */
-#include 
 #include 
 #include 
 #include 
diff --git a/security/integrity/ima/ima_appraise.c 
b/security/integrity/ima/ima_appraise.c
index deec1804a00a..2e11e750a067 100644
--- a/security/integrity/ima/ima_appraise.c
+++ b/security/integrity/ima/ima_appraise.c
@@ -8,7 +8,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Founda

[PATCH v3 00/18] mfd: demodularization of non-modular drivers

2018-12-07 Thread Paul Gortmaker
[v2 --> v3: drop diasemi commits as they will be modularized; delete
 now unused exit fcn from wm831x core; add more acks; re-test.]

[v1 --> v2: add some more commits as requested by Lee (MFD maintainer),
 update the 00/NN text; re-do build and link testing on new linux-next. ]

This group of MFD drivers are all controlled by "bool" Kconfig settings,
but contain various amounts of largely pointless uses of infrastructure
related to modular operations, even though they can't be built modular.

We can easily remove/replace all of it.  We are trying to make driver
code consistent with the Makefiles/Kconfigs that control them.  This
means not using modular functions/macros for drivers that can never be
built as a module.  Some of the downfalls this oversight leads to are:

 (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 a lot of CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

What we see in current drivers falls into one or more of the following
categories:

1) include of  when it simply isn't needed

2) Use of MODULE_LICENSE, MODULE_DEVICE_TABLE,  MODULE_AUTHOR etc. 
   macros that are no-ops for non-modular drivers.

3) Creation of a module_exit() function that will be compiled and
   linked in but never actually called for non-modular drivers.

4) Addition of a platform_driver ".remove" function that is bound
   into the struct but will never be called for non-module use cases.

Solution to #1 --> #3 is simple ; we just delete the related code.

The solution to #4 is similar - we delete the ".remove" function and
the binding into the platform_driver struct.  However, since the same
".remove" function could also be triggered by an "unbind" (such as for
pass-through of a device to a guest instance)  - so we also explicitly
disable any unbind for the driver.

The unbind mask allows us to ensure we will see if there was some odd
corner case out there that was relying on it.  Typically it would be a
multi-port ethernet card passing a port through to a guest, so a
sensible use case in MFD drivers seems highly unlikely.  This same
solution has already been used in multiple other mainline subsystems.

Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
and ARM-64 on a recent linux-next checkout.

Paul.

---

Cc: Alessandro Rubini 
Cc: Arnd Bergmann 
Cc: Charles Keepax 
Cc: Cory Maccarrone 
Cc: Davide Ciminaghi 
Cc: Dong Aisheng 
Cc: Graeme Gregory 
Cc: Guennadi Liakhovetski 
Cc: Haojian Zhuang 
Cc: Jin Park 
Cc: Jorge Eduardo Candelaria 
Cc: Laxman Dewangan 
Cc: Lee Jones 
Cc: Linus Walleij 
Cc: Mark Brown 
Cc: Mattias Nilsson 
Cc: Michael Hennerich 
Cc: Tony Lindgren 
Cc: Venu Byravarasu 
Cc: linux-o...@vger.kernel.org
Cc: patc...@opensource.cirrus.com


Paul Gortmaker (18):
  mfd: aat2870-core: Make it explicitly non-modular
  mfd: adp5520: Make it explicitly non-modular
  mfd: as3711: Make it explicitly non-modular
  mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  mfd: htc-i2cpld: Make it explicitly non-modular
  mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  mfd: rc5t583: Make it explicitly non-modular
  mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  mfd: syscon: Make it explicitly non-modular
  mfd: tps65090: Make it explicitly non-modular
  mfd: tps65910: Make it explicitly non-modular
  mfd: tps80031: Make it explicitly non-modular
  mfd: wm831x-spi: Make it explicitly non-modular
  mfd: wm831x-i2c: Make it explicitly non-modular
  mfd: wm831x-core: drop unused module infrastructure from non-modular code
  mfd: wm8350-i2c: Make it explicitly non-modular
  mfd: wm8350-core: drop unused MODULE_ tags from non-modular code
  mfd: wm8400-core: Make it explicitly non-modular

 drivers/mfd/aat2870-core.c  | 40 +++-
 drivers/mfd/adp5520.c   | 30 +++---
 drivers/mfd/as3711.c| 14 --
 drivers/mfd/db8500-prcmu.c  | 10 --
 drivers/mfd/htc-i2cpld.c| 18 +-
 drivers/mfd/max8925-core.c  |  7 +--
 drivers/mfd/rc5t583.c   | 14 --
 drivers/mfd/sta2x11-mfd.c   | 10 --
 drivers/mfd/syscon.c| 12 +---
 drivers/mfd/tps65090.c  | 30 +-
 drivers/mfd/tps65910.c  | 18 +-
 drivers/mfd/tps80031.c  | 37 ++---
 drivers/mfd/wm831x-core.c   | 15 ++-
 drivers/mfd/wm831x-i2c.c| 20 ++--
 drivers/mfd/wm831x-spi.c| 24 ++--
 drivers/mfd/wm8350-cor

[PATCH v3 00/18] mfd: demodularization of non-modular drivers

2018-12-07 Thread Paul Gortmaker
[v2 --> v3: drop diasemi commits as they will be modularized; delete
 now unused exit fcn from wm831x core; add more acks; re-test.]

[v1 --> v2: add some more commits as requested by Lee (MFD maintainer),
 update the 00/NN text; re-do build and link testing on new linux-next. ]

This group of MFD drivers are all controlled by "bool" Kconfig settings,
but contain various amounts of largely pointless uses of infrastructure
related to modular operations, even though they can't be built modular.

We can easily remove/replace all of it.  We are trying to make driver
code consistent with the Makefiles/Kconfigs that control them.  This
means not using modular functions/macros for drivers that can never be
built as a module.  Some of the downfalls this oversight leads to are:

 (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 a lot of CPP overhead.
 (4) it gets copied/replicated into other drivers and spreads quickly.

What we see in current drivers falls into one or more of the following
categories:

1) include of  when it simply isn't needed

2) Use of MODULE_LICENSE, MODULE_DEVICE_TABLE,  MODULE_AUTHOR etc. 
   macros that are no-ops for non-modular drivers.

3) Creation of a module_exit() function that will be compiled and
   linked in but never actually called for non-modular drivers.

4) Addition of a platform_driver ".remove" function that is bound
   into the struct but will never be called for non-module use cases.

Solution to #1 --> #3 is simple ; we just delete the related code.

The solution to #4 is similar - we delete the ".remove" function and
the binding into the platform_driver struct.  However, since the same
".remove" function could also be triggered by an "unbind" (such as for
pass-through of a device to a guest instance)  - so we also explicitly
disable any unbind for the driver.

The unbind mask allows us to ensure we will see if there was some odd
corner case out there that was relying on it.  Typically it would be a
multi-port ethernet card passing a port through to a guest, so a
sensible use case in MFD drivers seems highly unlikely.  This same
solution has already been used in multiple other mainline subsystems.

Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
and ARM-64 on a recent linux-next checkout.

Paul.

---

Cc: Alessandro Rubini 
Cc: Arnd Bergmann 
Cc: Charles Keepax 
Cc: Cory Maccarrone 
Cc: Davide Ciminaghi 
Cc: Dong Aisheng 
Cc: Graeme Gregory 
Cc: Guennadi Liakhovetski 
Cc: Haojian Zhuang 
Cc: Jin Park 
Cc: Jorge Eduardo Candelaria 
Cc: Laxman Dewangan 
Cc: Lee Jones 
Cc: Linus Walleij 
Cc: Mark Brown 
Cc: Mattias Nilsson 
Cc: Michael Hennerich 
Cc: Tony Lindgren 
Cc: Venu Byravarasu 
Cc: linux-o...@vger.kernel.org
Cc: patc...@opensource.cirrus.com


Paul Gortmaker (18):
  mfd: aat2870-core: Make it explicitly non-modular
  mfd: adp5520: Make it explicitly non-modular
  mfd: as3711: Make it explicitly non-modular
  mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  mfd: htc-i2cpld: Make it explicitly non-modular
  mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  mfd: rc5t583: Make it explicitly non-modular
  mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  mfd: syscon: Make it explicitly non-modular
  mfd: tps65090: Make it explicitly non-modular
  mfd: tps65910: Make it explicitly non-modular
  mfd: tps80031: Make it explicitly non-modular
  mfd: wm831x-spi: Make it explicitly non-modular
  mfd: wm831x-i2c: Make it explicitly non-modular
  mfd: wm831x-core: drop unused module infrastructure from non-modular code
  mfd: wm8350-i2c: Make it explicitly non-modular
  mfd: wm8350-core: drop unused MODULE_ tags from non-modular code
  mfd: wm8400-core: Make it explicitly non-modular

 drivers/mfd/aat2870-core.c  | 40 +++-
 drivers/mfd/adp5520.c   | 30 +++---
 drivers/mfd/as3711.c| 14 --
 drivers/mfd/db8500-prcmu.c  | 10 --
 drivers/mfd/htc-i2cpld.c| 18 +-
 drivers/mfd/max8925-core.c  |  7 +--
 drivers/mfd/rc5t583.c   | 14 --
 drivers/mfd/sta2x11-mfd.c   | 10 --
 drivers/mfd/syscon.c| 12 +---
 drivers/mfd/tps65090.c  | 30 +-
 drivers/mfd/tps65910.c  | 18 +-
 drivers/mfd/tps80031.c  | 37 ++---
 drivers/mfd/wm831x-core.c   | 15 ++-
 drivers/mfd/wm831x-i2c.c| 20 ++--
 drivers/mfd/wm831x-spi.c| 24 ++--
 drivers/mfd/wm8350-cor

[PATCH 17/18] mfd: wm8350-core: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350
drivers/mfd/Kconfig:bool

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8350-core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 8a07c5634aee..e6434a4d7439 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -466,6 +467,3 @@ void wm8350_device_exit(struct wm8350 *wm8350)
wm8350_irq_exit(wm8350);
 }
 EXPORT_SYMBOL_GPL(wm8350_device_exit);
-
-MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 17/18] mfd: wm8350-core: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350
drivers/mfd/Kconfig:bool

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8350-core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index 8a07c5634aee..e6434a4d7439 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -466,6 +467,3 @@ void wm8350_device_exit(struct wm8350 *wm8350)
wm8350_irq_exit(wm8350);
 }
 EXPORT_SYMBOL_GPL(wm8350_device_exit);
-
-MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8350 with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
But we do delete an unused moduleparam.h

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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8350-i2c.c | 24 +---
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 9358f03b7938..b4194e068e1b 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -48,30 +46,19 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
return wm8350_device_init(wm8350, i2c->irq, pdata);
 }
 
-static int wm8350_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
-
-   wm8350_device_exit(wm8350);
-
-   return 0;
-}
-
 static const struct i2c_device_id wm8350_i2c_id[] = {
{ "wm8350", 0 },
{ "wm8351", 0 },
{ "wm8352", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8350_i2c_id);
-
 
 static struct i2c_driver wm8350_i2c_driver = {
.driver = {
   .name = "wm8350",
+  .suppress_bind_attrs = true,
},
.probe = wm8350_i2c_probe,
-   .remove = wm8350_i2c_remove,
.id_table = wm8350_i2c_id,
 };
 
@@ -81,12 +68,3 @@ static int __init wm8350_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(wm8350_i2c_init);
-
-static void __exit wm8350_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm8350_i2c_exit);
-
-MODULE_DESCRIPTION("I2C support for the WM8350 AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 16/18] mfd: wm8350-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8350_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8350 with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
But we do delete an unused moduleparam.h

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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8350-i2c.c | 24 +---
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 9358f03b7938..b4194e068e1b 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -48,30 +46,19 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
return wm8350_device_init(wm8350, i2c->irq, pdata);
 }
 
-static int wm8350_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm8350 *wm8350 = i2c_get_clientdata(i2c);
-
-   wm8350_device_exit(wm8350);
-
-   return 0;
-}
-
 static const struct i2c_device_id wm8350_i2c_id[] = {
{ "wm8350", 0 },
{ "wm8351", 0 },
{ "wm8352", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8350_i2c_id);
-
 
 static struct i2c_driver wm8350_i2c_driver = {
.driver = {
   .name = "wm8350",
+  .suppress_bind_attrs = true,
},
.probe = wm8350_i2c_probe,
-   .remove = wm8350_i2c_remove,
.id_table = wm8350_i2c_id,
 };
 
@@ -81,12 +68,3 @@ static int __init wm8350_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(wm8350_i2c_init);
-
-static void __exit wm8350_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm8350_i2c_exit);
-
-MODULE_DESCRIPTION("I2C support for the WM8350 AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 15/18] mfd: wm831x-core: drop unused module infrastructure from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X
drivers/mfd/Kconfig:bool

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

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

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

Previous demodularizaion work has made wm831x_device_exit() no longer
used, so it is also removed from the 831x core code.

Cc: Lee Jones 
Cc: Charles Keepax 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-core.c   | 15 ++-
 include/linux/mfd/wm831x/core.h |  1 -
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index e70d35ef5c6d..25fbbaf39cb9 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1892,14 +1893,6 @@ int wm831x_device_init(struct wm831x *wm831x, int irq)
return ret;
 }
 
-void wm831x_device_exit(struct wm831x *wm831x)
-{
-   wm831x_otp_exit(wm831x);
-   mfd_remove_devices(wm831x->dev);
-   free_irq(wm831x_irq(wm831x, WM831X_IRQ_AUXADC_DATA), wm831x);
-   wm831x_irq_exit(wm831x);
-}
-
 int wm831x_device_suspend(struct wm831x *wm831x)
 {
int reg, mask;
@@ -1944,7 +1937,3 @@ void wm831x_device_shutdown(struct wm831x *wm831x)
}
 }
 EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
-
-MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index b49fa67612f1..6fcb8eb00282 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -418,7 +418,6 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short 
reg,
 int count, u16 *buf);
 
 int wm831x_device_init(struct wm831x *wm831x, int irq);
-void wm831x_device_exit(struct wm831x *wm831x);
 int wm831x_device_suspend(struct wm831x *wm831x);
 void wm831x_device_shutdown(struct wm831x *wm831x);
 int wm831x_irq_init(struct wm831x *wm831x, int irq);
-- 
2.7.4



[PATCH 11/18] mfd: tps65910: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65910
drivers/mfd/Kconfig-bool "TI TPS65910 Power Management chip"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
We do delete an unused moduleparam.h include though.

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: Tony Lindgren 
Cc: Lee Jones 
Cc: Graeme Gregory 
Cc: Jorge Eduardo Candelaria 
Cc: linux-o...@vger.kernel.org
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps65910.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf16cbe6fd88..aa3d472a10ff 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -1,5 +1,5 @@
 /*
- * tps65910.c  --  TI TPS6591x
+ * tps65910.c  --  TI TPS6591x chip family multi-function driver
  *
  * Copyright 2010 Texas Instruments Inc.
  *
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
{ },
 };
-MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
unsigned long *chip_id)
@@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
{ "tps65911", TPS65911 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
-
 
 static struct i2c_driver tps65910_i2c_driver = {
.driver = {
@@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(tps65910_i2c_init);
-
-static void __exit tps65910_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(tps65910_i2c_exit);
-
-MODULE_AUTHOR("Graeme Gregory ");
-MODULE_AUTHOR("Jorge Eduardo Candelaria ");
-MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8400
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8400"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

A trivial function rename from wm8400_module_init to the name
wm8400_driver_init is also done to reduce possible confusion.

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: Lee Jones 
Cc: Mark Brown 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8400-core.c | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 8a98a2fc74e1..79756c83f5f0 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -12,7 +12,7 @@
  *
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -150,7 +150,6 @@ static const struct i2c_device_id wm8400_i2c_id[] = {
{ "wm8400", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
 
 static struct i2c_driver wm8400_i2c_driver = {
.driver = {
@@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
 };
 #endif
 
-static int __init wm8400_module_init(void)
+static int __init wm8400_driver_init(void)
 {
int ret = -ENODEV;
 
@@ -173,15 +172,4 @@ static int __init wm8400_module_init(void)
 
return ret;
 }
-subsys_initcall(wm8400_module_init);
-
-static void __exit wm8400_module_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-   i2c_del_driver(_i2c_driver);
-#endif
-}
-module_exit(wm8400_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown ");
+subsys_initcall(wm8400_driver_init);
-- 
2.7.4



[PATCH 15/18] mfd: wm831x-core: drop unused module infrastructure from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X
drivers/mfd/Kconfig:bool

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

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

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

Previous demodularizaion work has made wm831x_device_exit() no longer
used, so it is also removed from the 831x core code.

Cc: Lee Jones 
Cc: Charles Keepax 
Cc: patc...@opensource.cirrus.com
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-core.c   | 15 ++-
 include/linux/mfd/wm831x/core.h |  1 -
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index e70d35ef5c6d..25fbbaf39cb9 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -13,7 +13,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1892,14 +1893,6 @@ int wm831x_device_init(struct wm831x *wm831x, int irq)
return ret;
 }
 
-void wm831x_device_exit(struct wm831x *wm831x)
-{
-   wm831x_otp_exit(wm831x);
-   mfd_remove_devices(wm831x->dev);
-   free_irq(wm831x_irq(wm831x, WM831X_IRQ_AUXADC_DATA), wm831x);
-   wm831x_irq_exit(wm831x);
-}
-
 int wm831x_device_suspend(struct wm831x *wm831x)
 {
int reg, mask;
@@ -1944,7 +1937,3 @@ void wm831x_device_shutdown(struct wm831x *wm831x)
}
 }
 EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
-
-MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index b49fa67612f1..6fcb8eb00282 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -418,7 +418,6 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short 
reg,
 int count, u16 *buf);
 
 int wm831x_device_init(struct wm831x *wm831x, int irq);
-void wm831x_device_exit(struct wm831x *wm831x);
 int wm831x_device_suspend(struct wm831x *wm831x);
 void wm831x_device_shutdown(struct wm831x *wm831x);
 int wm831x_irq_init(struct wm831x *wm831x, int irq);
-- 
2.7.4



[PATCH 11/18] mfd: tps65910: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65910
drivers/mfd/Kconfig-bool "TI TPS65910 Power Management chip"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
We do delete an unused moduleparam.h include though.

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: Tony Lindgren 
Cc: Lee Jones 
Cc: Graeme Gregory 
Cc: Jorge Eduardo Candelaria 
Cc: linux-o...@vger.kernel.org
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps65910.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf16cbe6fd88..aa3d472a10ff 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -1,5 +1,5 @@
 /*
- * tps65910.c  --  TI TPS6591x
+ * tps65910.c  --  TI TPS6591x chip family multi-function driver
  *
  * Copyright 2010 Texas Instruments Inc.
  *
@@ -13,8 +13,6 @@
  *
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
{ },
 };
-MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
unsigned long *chip_id)
@@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
{ "tps65911", TPS65911 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
-
 
 static struct i2c_driver tps65910_i2c_driver = {
.driver = {
@@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(tps65910_i2c_init);
-
-static void __exit tps65910_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(tps65910_i2c_exit);
-
-MODULE_AUTHOR("Graeme Gregory ");
-MODULE_AUTHOR("Jorge Eduardo Candelaria ");
-MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4



[PATCH 18/18] mfd: wm8400-core: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8400
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM8400"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

A trivial function rename from wm8400_module_init to the name
wm8400_driver_init is also done to reduce possible confusion.

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: Lee Jones 
Cc: Mark Brown 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm8400-core.c | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 8a98a2fc74e1..79756c83f5f0 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -12,7 +12,7 @@
  *
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -150,7 +150,6 @@ static const struct i2c_device_id wm8400_i2c_id[] = {
{ "wm8400", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
 
 static struct i2c_driver wm8400_i2c_driver = {
.driver = {
@@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
 };
 #endif
 
-static int __init wm8400_module_init(void)
+static int __init wm8400_driver_init(void)
 {
int ret = -ENODEV;
 
@@ -173,15 +172,4 @@ static int __init wm8400_module_init(void)
 
return ret;
 }
-subsys_initcall(wm8400_module_init);
-
-static void __exit wm8400_module_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-   i2c_del_driver(_i2c_driver);
-#endif
-}
-module_exit(wm8400_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown ");
+subsys_initcall(wm8400_driver_init);
-- 
2.7.4



[PATCH 12/18] mfd: tps80031: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS80031
drivers/mfd/Kconfig:bool "TI TPS80031/TPS80032 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Laxman Dewangan 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps80031.c | 37 ++---
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index 608c7f77830e..865257ade8ac 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -516,40 +515,18 @@ static int tps80031_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps80031_remove(struct i2c_client *client)
-{
-   struct tps80031 *tps80031 = i2c_get_clientdata(client);
-   int i;
-
-   if (tps80031_power_off_dev == tps80031) {
-   tps80031_power_off_dev = NULL;
-   pm_power_off = NULL;
-   }
-
-   mfd_remove_devices(tps80031->dev);
-
-   regmap_del_irq_chip(client->irq, tps80031->irq_data);
-
-   for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
-   if (tps80031->clients[i] != client)
-   i2c_unregister_device(tps80031->clients[i]);
-   }
-   return 0;
-}
-
 static const struct i2c_device_id tps80031_id_table[] = {
{ "tps80031", TPS80031 },
{ "tps80032", TPS80032 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
 
 static struct i2c_driver tps80031_driver = {
.driver = {
-   .name   = "tps80031",
+   .name   = "tps80031",
+   .suppress_bind_attrs= true,
},
.probe  = tps80031_probe,
-   .remove = tps80031_remove,
.id_table   = tps80031_id_table,
 };
 
@@ -558,13 +535,3 @@ static int __init tps80031_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps80031_init);
-
-static void __exit tps80031_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps80031_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("TPS80031 core driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 12/18] mfd: tps80031: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS80031
drivers/mfd/Kconfig:bool "TI TPS80031/TPS80032 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Laxman Dewangan 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps80031.c | 37 ++---
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index 608c7f77830e..865257ade8ac 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -516,40 +515,18 @@ static int tps80031_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps80031_remove(struct i2c_client *client)
-{
-   struct tps80031 *tps80031 = i2c_get_clientdata(client);
-   int i;
-
-   if (tps80031_power_off_dev == tps80031) {
-   tps80031_power_off_dev = NULL;
-   pm_power_off = NULL;
-   }
-
-   mfd_remove_devices(tps80031->dev);
-
-   regmap_del_irq_chip(client->irq, tps80031->irq_data);
-
-   for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
-   if (tps80031->clients[i] != client)
-   i2c_unregister_device(tps80031->clients[i]);
-   }
-   return 0;
-}
-
 static const struct i2c_device_id tps80031_id_table[] = {
{ "tps80031", TPS80031 },
{ "tps80032", TPS80032 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
 
 static struct i2c_driver tps80031_driver = {
.driver = {
-   .name   = "tps80031",
+   .name   = "tps80031",
+   .suppress_bind_attrs= true,
},
.probe  = tps80031_probe,
-   .remove = tps80031_remove,
.id_table   = tps80031_id_table,
 };
 
@@ -558,13 +535,3 @@ static int __init tps80031_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps80031_init);
-
-static void __exit tps80031_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps80031_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("TPS80031 core driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 14/18] mfd: wm831x-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-i2c.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c
index 22f7054d1b28..0f3af42f7268 100644
--- a/drivers/mfd/wm831x-i2c.c
+++ b/drivers/mfd/wm831x-i2c.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,15 +68,6 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
return wm831x_device_init(wm831x, i2c->irq);
 }
 
-static int wm831x_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm831x *wm831x = i2c_get_clientdata(i2c);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_i2c_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -103,7 +94,6 @@ static const struct i2c_device_id wm831x_i2c_id[] = {
{ "wm8326", WM8326 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
 
 static const struct dev_pm_ops wm831x_pm_ops = {
.suspend = wm831x_i2c_suspend,
@@ -115,9 +105,9 @@ static struct i2c_driver wm831x_i2c_driver = {
.name = "wm831x",
.pm = _pm_ops,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.probe = wm831x_i2c_probe,
-   .remove = wm831x_i2c_remove,
.id_table = wm831x_i2c_id,
 };
 
@@ -132,9 +122,3 @@ static int __init wm831x_i2c_init(void)
return ret;
 }
 subsys_initcall(wm831x_i2c_init);
-
-static void __exit wm831x_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm831x_i2c_exit);
-- 
2.7.4



[PATCH 14/18] mfd: wm831x-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_I2C
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with I2C"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

Cc: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-i2c.c | 20 ++--
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c
index 22f7054d1b28..0f3af42f7268 100644
--- a/drivers/mfd/wm831x-i2c.c
+++ b/drivers/mfd/wm831x-i2c.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,15 +68,6 @@ static int wm831x_i2c_probe(struct i2c_client *i2c,
return wm831x_device_init(wm831x, i2c->irq);
 }
 
-static int wm831x_i2c_remove(struct i2c_client *i2c)
-{
-   struct wm831x *wm831x = i2c_get_clientdata(i2c);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_i2c_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -103,7 +94,6 @@ static const struct i2c_device_id wm831x_i2c_id[] = {
{ "wm8326", WM8326 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
 
 static const struct dev_pm_ops wm831x_pm_ops = {
.suspend = wm831x_i2c_suspend,
@@ -115,9 +105,9 @@ static struct i2c_driver wm831x_i2c_driver = {
.name = "wm831x",
.pm = _pm_ops,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.probe = wm831x_i2c_probe,
-   .remove = wm831x_i2c_remove,
.id_table = wm831x_i2c_id,
 };
 
@@ -132,9 +122,3 @@ static int __init wm831x_i2c_init(void)
return ret;
 }
 subsys_initcall(wm831x_i2c_init);
-
-static void __exit wm831x_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(wm831x_i2c_exit);
-- 
2.7.4



[PATCH 08/18] mfd: sta2x11: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_STA2X11
drivers/mfd/Kconfig:bool "STMicroelectronics STA2X11"

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

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Lee Jones 
Cc: Alessandro Rubini 
Cc: Davide Ciminaghi 
Acked-by: Alessandro Rubini 
Acked-by: Davide Ciminaghi 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/sta2x11-mfd.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 3aeafa228baf..cab9aabcaa1f 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -1,4 +1,6 @@
 /*
+ * STA2x11 mfd for GPIO, SCTL and APBREG
+ *
  * Copyright (c) 2009-2011 Wind River Systems, Inc.
  * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini, Davide Ciminaghi)
  *
@@ -18,7 +20,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -653,8 +656,3 @@ static int __init sta2x11_mfd_init(void)
  */
 subsys_initcall(sta2x11_drivers_init);
 rootfs_initcall(sta2x11_mfd_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wind River");
-MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
-MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);
-- 
2.7.4



[PATCH 08/18] mfd: sta2x11: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_STA2X11
drivers/mfd/Kconfig:bool "STMicroelectronics STA2X11"

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

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Lee Jones 
Cc: Alessandro Rubini 
Cc: Davide Ciminaghi 
Acked-by: Alessandro Rubini 
Acked-by: Davide Ciminaghi 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/sta2x11-mfd.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 3aeafa228baf..cab9aabcaa1f 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -1,4 +1,6 @@
 /*
+ * STA2x11 mfd for GPIO, SCTL and APBREG
+ *
  * Copyright (c) 2009-2011 Wind River Systems, Inc.
  * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini, Davide Ciminaghi)
  *
@@ -18,7 +20,8 @@
  */
 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -653,8 +656,3 @@ static int __init sta2x11_mfd_init(void)
  */
 subsys_initcall(sta2x11_drivers_init);
 rootfs_initcall(sta2x11_mfd_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wind River");
-MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
-MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);
-- 
2.7.4



[PATCH 13/18] mfd: wm831x-spi: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_SPI
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with SPI"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-spi.c | 24 ++--
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 018ce652ae57..dd4dab419940 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,15 +67,6 @@ static int wm831x_spi_probe(struct spi_device *spi)
return wm831x_device_init(wm831x, spi->irq);
 }
 
-static int wm831x_spi_remove(struct spi_device *spi)
-{
-   struct wm831x *wm831x = spi_get_drvdata(spi);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_spi_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -108,17 +99,16 @@ static const struct spi_device_id wm831x_spi_ids[] = {
{ "wm8326", WM8326 },
{ },
 };
-MODULE_DEVICE_TABLE(spi, wm831x_spi_ids);
 
 static struct spi_driver wm831x_spi_driver = {
.driver = {
.name   = "wm831x",
.pm = _spi_pm,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.id_table   = wm831x_spi_ids,
.probe  = wm831x_spi_probe,
-   .remove = wm831x_spi_remove,
 };
 
 static int __init wm831x_spi_init(void)
@@ -132,13 +122,3 @@ static int __init wm831x_spi_init(void)
return 0;
 }
 subsys_initcall(wm831x_spi_init);
-
-static void __exit wm831x_spi_exit(void)
-{
-   spi_unregister_driver(_spi_driver);
-}
-module_exit(wm831x_spi_exit);
-
-MODULE_DESCRIPTION("SPI support for WM831x/2x AudioPlus PMICs");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
-- 
2.7.4



[PATCH 13/18] mfd: wm831x-spi: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_SPI
drivers/mfd/Kconfig:bool "Wolfson Microelectronics WM831x/2x PMICs with SPI"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: patc...@opensource.cirrus.com
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/wm831x-spi.c | 24 ++--
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 018ce652ae57..dd4dab419940 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -13,7 +13,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,15 +67,6 @@ static int wm831x_spi_probe(struct spi_device *spi)
return wm831x_device_init(wm831x, spi->irq);
 }
 
-static int wm831x_spi_remove(struct spi_device *spi)
-{
-   struct wm831x *wm831x = spi_get_drvdata(spi);
-
-   wm831x_device_exit(wm831x);
-
-   return 0;
-}
-
 static int wm831x_spi_suspend(struct device *dev)
 {
struct wm831x *wm831x = dev_get_drvdata(dev);
@@ -108,17 +99,16 @@ static const struct spi_device_id wm831x_spi_ids[] = {
{ "wm8326", WM8326 },
{ },
 };
-MODULE_DEVICE_TABLE(spi, wm831x_spi_ids);
 
 static struct spi_driver wm831x_spi_driver = {
.driver = {
.name   = "wm831x",
.pm = _spi_pm,
.of_match_table = of_match_ptr(wm831x_of_match),
+   .suppress_bind_attrs = true,
},
.id_table   = wm831x_spi_ids,
.probe  = wm831x_spi_probe,
-   .remove = wm831x_spi_remove,
 };
 
 static int __init wm831x_spi_init(void)
@@ -132,13 +122,3 @@ static int __init wm831x_spi_init(void)
return 0;
 }
 subsys_initcall(wm831x_spi_init);
-
-static void __exit wm831x_spi_exit(void)
-{
-   spi_unregister_driver(_spi_driver);
-}
-module_exit(wm831x_spi_exit);
-
-MODULE_DESCRIPTION("SPI support for WM831x/2x AudioPlus PMICs");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
-- 
2.7.4



[PATCH 07/18] mfd: rc5t583: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_RC5T583
drivers/mfd/Kconfig:bool "Ricoh RC5T583 Power Management system device"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Laxman Dewangan 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/rc5t583.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index fd46de02b715..c5cc5cb3dde7 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -298,8 +297,6 @@ static const struct i2c_device_id rc5t583_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
-
 static struct i2c_driver rc5t583_i2c_driver = {
.driver = {
   .name = "rc5t583",
@@ -313,14 +310,3 @@ static int __init rc5t583_i2c_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(rc5t583_i2c_init);
-
-static void __exit rc5t583_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-
-module_exit(rc5t583_i2c_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("RICOH RC5T583 power management system device driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 04/18] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
drivers/mfd/Kconfig:bool "ST-Ericsson DB8500 Power Reset Control Management 
Unit"

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: Mattias Nilsson 
Reviewed-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/db8500-prcmu.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index aec20e1c7d3d..65666b624ae8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1,4 +1,6 @@
 /*
+ * DB8500 PRCM Unit driver
+ *
  * Copyright (C) STMicroelectronics 2009
  * Copyright (C) ST-Ericsson SA 2010
  *
@@ -10,7 +12,8 @@
  * U8500 PRCM Unit interface driver
  *
  */
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -3188,9 +3191,4 @@ static int __init db8500_prcmu_init(void)
 {
return platform_driver_register(_prcmu_driver);
 }
-
 core_initcall(db8500_prcmu_init);
-
-MODULE_AUTHOR("Mattias Nilsson ");
-MODULE_DESCRIPTION("DB8500 PRCM Unit driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 09/18] mfd: syscon: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SYSCON
drivers/mfd/Kconfig:bool "System Controller Register R/W Based on Regmap"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Arnd Bergmann 
Cc: Dong Aisheng 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/syscon.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b6d05cd934e6..0ecdffb3d967 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -272,13 +272,3 @@ static int __init syscon_init(void)
return platform_driver_register(_driver);
 }
 postcore_initcall(syscon_init);
-
-static void __exit syscon_exit(void)
-{
-   platform_driver_unregister(_driver);
-}
-module_exit(syscon_exit);
-
-MODULE_AUTHOR("Dong Aisheng ");
-MODULE_DESCRIPTION("System Control driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 10/18] mfd: tps65090: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65090
drivers/mfd/Kconfig:bool "TI TPS65090 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Venu Byravarasu 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps65090.c | 30 +-
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index f13e4cd06e89..6968df4d7828 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -2,7 +2,9 @@
  * Core driver for TI TPS65090 PMIC family
  *
  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
-
+ *
+ * Author: Venu Byravarasu 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -171,7 +173,6 @@ static const struct of_device_id tps65090_of_match[] = {
{ .compatible = "ti,tps65090",},
{},
 };
-MODULE_DEVICE_TABLE(of, tps65090_of_match);
 #endif
 
 static int tps65090_i2c_probe(struct i2c_client *client,
@@ -236,30 +237,19 @@ static int tps65090_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps65090_i2c_remove(struct i2c_client *client)
-{
-   struct tps65090 *tps65090 = i2c_get_clientdata(client);
-
-   mfd_remove_devices(tps65090->dev);
-   if (client->irq)
-   regmap_del_irq_chip(client->irq, tps65090->irq_data);
-
-   return 0;
-}
 
 static const struct i2c_device_id tps65090_id_table[] = {
{ "tps65090", 0 },
{ },
 };
-MODULE_DEVICE_TABLE(i2c, tps65090_id_table);
 
 static struct i2c_driver tps65090_driver = {
.driver = {
.name   = "tps65090",
+   .suppress_bind_attrs = true,
.of_match_table = of_match_ptr(tps65090_of_match),
},
.probe  = tps65090_i2c_probe,
-   .remove = tps65090_i2c_remove,
.id_table   = tps65090_id_table,
 };
 
@@ -268,13 +258,3 @@ static int __init tps65090_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps65090_init);
-
-static void __exit tps65090_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps65090_exit);
-
-MODULE_DESCRIPTION("TPS65090 core driver");
-MODULE_AUTHOR("Venu Byravarasu ");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 10/18] mfd: tps65090: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65090
drivers/mfd/Kconfig:bool "TI TPS65090 Power Management chips"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Venu Byravarasu 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/tps65090.c | 30 +-
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index f13e4cd06e89..6968df4d7828 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -2,7 +2,9 @@
  * Core driver for TI TPS65090 PMIC family
  *
  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
-
+ *
+ * Author: Venu Byravarasu 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -19,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -171,7 +173,6 @@ static const struct of_device_id tps65090_of_match[] = {
{ .compatible = "ti,tps65090",},
{},
 };
-MODULE_DEVICE_TABLE(of, tps65090_of_match);
 #endif
 
 static int tps65090_i2c_probe(struct i2c_client *client,
@@ -236,30 +237,19 @@ static int tps65090_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int tps65090_i2c_remove(struct i2c_client *client)
-{
-   struct tps65090 *tps65090 = i2c_get_clientdata(client);
-
-   mfd_remove_devices(tps65090->dev);
-   if (client->irq)
-   regmap_del_irq_chip(client->irq, tps65090->irq_data);
-
-   return 0;
-}
 
 static const struct i2c_device_id tps65090_id_table[] = {
{ "tps65090", 0 },
{ },
 };
-MODULE_DEVICE_TABLE(i2c, tps65090_id_table);
 
 static struct i2c_driver tps65090_driver = {
.driver = {
.name   = "tps65090",
+   .suppress_bind_attrs = true,
.of_match_table = of_match_ptr(tps65090_of_match),
},
.probe  = tps65090_i2c_probe,
-   .remove = tps65090_i2c_remove,
.id_table   = tps65090_id_table,
 };
 
@@ -268,13 +258,3 @@ static int __init tps65090_init(void)
return i2c_add_driver(_driver);
 }
 subsys_initcall(tps65090_init);
-
-static void __exit tps65090_exit(void)
-{
-   i2c_del_driver(_driver);
-}
-module_exit(tps65090_exit);
-
-MODULE_DESCRIPTION("TPS65090 core driver");
-MODULE_AUTHOR("Venu Byravarasu ");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 07/18] mfd: rc5t583: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_RC5T583
drivers/mfd/Kconfig:bool "Ricoh RC5T583 Power Management system device"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Laxman Dewangan 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/rc5t583.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index fd46de02b715..c5cc5cb3dde7 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -298,8 +297,6 @@ static const struct i2c_device_id rc5t583_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
-
 static struct i2c_driver rc5t583_i2c_driver = {
.driver = {
   .name = "rc5t583",
@@ -313,14 +310,3 @@ static int __init rc5t583_i2c_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(rc5t583_i2c_init);
-
-static void __exit rc5t583_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-
-module_exit(rc5t583_i2c_exit);
-
-MODULE_AUTHOR("Laxman Dewangan ");
-MODULE_DESCRIPTION("RICOH RC5T583 power management system device driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 04/18] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
drivers/mfd/Kconfig:bool "ST-Ericsson DB8500 Power Reset Control Management 
Unit"

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

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

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

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij 
Cc: Lee Jones 
Cc: Mattias Nilsson 
Reviewed-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/db8500-prcmu.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index aec20e1c7d3d..65666b624ae8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1,4 +1,6 @@
 /*
+ * DB8500 PRCM Unit driver
+ *
  * Copyright (C) STMicroelectronics 2009
  * Copyright (C) ST-Ericsson SA 2010
  *
@@ -10,7 +12,8 @@
  * U8500 PRCM Unit interface driver
  *
  */
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -3188,9 +3191,4 @@ static int __init db8500_prcmu_init(void)
 {
return platform_driver_register(_prcmu_driver);
 }
-
 core_initcall(db8500_prcmu_init);
-
-MODULE_AUTHOR("Mattias Nilsson ");
-MODULE_DESCRIPTION("DB8500 PRCM Unit driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 09/18] mfd: syscon: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SYSCON
drivers/mfd/Kconfig:bool "System Controller Register R/W Based on Regmap"

...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_init was not in use by this code, 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: Lee Jones 
Cc: Arnd Bergmann 
Cc: Dong Aisheng 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/syscon.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b6d05cd934e6..0ecdffb3d967 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -272,13 +272,3 @@ static int __init syscon_init(void)
return platform_driver_register(_driver);
 }
 postcore_initcall(syscon_init);
-
-static void __exit syscon_exit(void)
-{
-   platform_driver_unregister(_driver);
-}
-module_exit(syscon_exit);
-
-MODULE_AUTHOR("Dong Aisheng ");
-MODULE_DESCRIPTION("System Control driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 03/18] mfd: as3711: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:bool "AMS AS3711"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Guennadi Liakhovetski 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/as3711.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 67b12417585d..7a74a874b93c 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -118,7 +117,6 @@ static const struct of_device_id as3711_of_match[] = {
{.compatible = "ams,as3711",},
{}
 };
-MODULE_DEVICE_TABLE(of, as3711_of_match);
 #endif
 
 static int as3711_i2c_probe(struct i2c_client *client,
@@ -202,8 +200,6 @@ static const struct i2c_device_id as3711_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
-
 static struct i2c_driver as3711_i2c_driver = {
.driver = {
   .name = "as3711",
@@ -219,13 +215,3 @@ static int __init as3711_i2c_init(void)
 }
 /* Initialise early */
 subsys_initcall(as3711_i2c_init);
-
-static void __exit as3711_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(as3711_i2c_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski ");
-MODULE_DESCRIPTION("AS3711 PMIC driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 05/18] mfd: htc-i2cpld: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig for this option is currently:

config HTC_I2CPLD
bool "HTC I2C PLD chip 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_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: Cory Maccarrone 
Cc: Lee Jones 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/htc-i2cpld.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 01572b5e79e8..af3c66355270 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -27,7 +27,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -614,8 +613,6 @@ static const struct i2c_device_id htcpld_chip_id[] = {
{ "htcpld-chip", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, htcpld_chip_id);
-
 
 static struct i2c_driver htcpld_chip_driver = {
.driver = {
@@ -643,17 +640,4 @@ static int __init htcpld_core_init(void)
/* Probe for our chips */
return platform_driver_probe(_core_driver, htcpld_core_probe);
 }
-
-static void __exit htcpld_core_exit(void)
-{
-   i2c_del_driver(_chip_driver);
-   platform_driver_unregister(_core_driver);
-}
-
-module_init(htcpld_core_init);
-module_exit(htcpld_core_exit);
-
-MODULE_AUTHOR("Cory Maccarrone ");
-MODULE_DESCRIPTION("I2C HTC PLD Driver");
-MODULE_LICENSE("GPL");
-
+device_initcall(htcpld_core_init);
-- 
2.7.4



[PATCH 01/18] mfd: aat2870-core: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AAT2870_CORE
drivers/mfd/Kconfig:bool "AnalogicTech AAT2870"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Jin Park 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/aat2870-core.c | 40 +++-
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 3ba19a45f199..9d3d90d386c2 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -20,7 +20,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -349,18 +348,10 @@ static void aat2870_init_debugfs(struct aat2870_data 
*aat2870)
 "Failed to create debugfs register file\n");
 }
 
-static void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-   debugfs_remove_recursive(aat2870->dentry_root);
-}
 #else
 static inline void aat2870_init_debugfs(struct aat2870_data *aat2870)
 {
 }
-
-static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-}
 #endif /* CONFIG_DEBUG_FS */
 
 static int aat2870_i2c_probe(struct i2c_client *client,
@@ -440,20 +431,6 @@ static int aat2870_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int aat2870_i2c_remove(struct i2c_client *client)
-{
-   struct aat2870_data *aat2870 = i2c_get_clientdata(client);
-
-   aat2870_uninit_debugfs(aat2870);
-
-   mfd_remove_devices(aat2870->dev);
-   aat2870_disable(aat2870);
-   if (aat2870->uninit)
-   aat2870->uninit(aat2870);
-
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
@@ -492,15 +469,14 @@ static const struct i2c_device_id aat2870_i2c_id_table[] 
= {
{ "aat2870", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table);
 
 static struct i2c_driver aat2870_i2c_driver = {
.driver = {
-   .name   = "aat2870",
-   .pm = _pm_ops,
+   .name   = "aat2870",
+   .pm = _pm_ops,
+   .suppress_bind_attrs= true,
},
.probe  = aat2870_i2c_probe,
-   .remove = aat2870_i2c_remove,
.id_table   = aat2870_i2c_id_table,
 };
 
@@ -509,13 +485,3 @@ static int __init aat2870_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(aat2870_init);
-
-static void __exit aat2870_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(aat2870_exit);
-
-MODULE_DESCRIPTION("Core support for the AnalogicTech AAT2870");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jin Park ");
-- 
2.7.4



[PATCH 06/18] mfd: max8925-core: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8925
drivers/mfd/Kconfig:bool "Maxim Semiconductor MAX8925 PMIC Support"

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

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

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

Cc: Lee Jones 
Cc: Haojian Zhuang 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/max8925-core.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index fd8b15cd84fd..87c724ba9793 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -10,7 +10,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -919,8 +919,3 @@ void max8925_device_exit(struct max8925_chip *chip)
free_irq(chip->tsc_irq, chip);
mfd_remove_devices(chip->dev);
 }
-
-
-MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925");
-MODULE_AUTHOR("Haojian Zhuang 

[PATCH 06/18] mfd: max8925-core: drop unused MODULE_ tags from non-modular code

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8925
drivers/mfd/Kconfig:bool "Maxim Semiconductor MAX8925 PMIC Support"

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

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

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

Cc: Lee Jones 
Cc: Haojian Zhuang 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/max8925-core.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index fd8b15cd84fd..87c724ba9793 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -10,7 +10,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -919,8 +919,3 @@ void max8925_device_exit(struct max8925_chip *chip)
free_irq(chip->tsc_irq, chip);
mfd_remove_devices(chip->dev);
 }
-
-
-MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925");
-MODULE_AUTHOR("Haojian Zhuang 

[PATCH 03/18] mfd: as3711: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:bool "AMS AS3711"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

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

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: Lee Jones 
Cc: Guennadi Liakhovetski 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/as3711.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 67b12417585d..7a74a874b93c 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -118,7 +117,6 @@ static const struct of_device_id as3711_of_match[] = {
{.compatible = "ams,as3711",},
{}
 };
-MODULE_DEVICE_TABLE(of, as3711_of_match);
 #endif
 
 static int as3711_i2c_probe(struct i2c_client *client,
@@ -202,8 +200,6 @@ static const struct i2c_device_id as3711_i2c_id[] = {
{}
 };
 
-MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
-
 static struct i2c_driver as3711_i2c_driver = {
.driver = {
   .name = "as3711",
@@ -219,13 +215,3 @@ static int __init as3711_i2c_init(void)
 }
 /* Initialise early */
 subsys_initcall(as3711_i2c_init);
-
-static void __exit as3711_i2c_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(as3711_i2c_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski ");
-MODULE_DESCRIPTION("AS3711 PMIC driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4



[PATCH 05/18] mfd: htc-i2cpld: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig for this option is currently:

config HTC_I2CPLD
bool "HTC I2C PLD chip 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_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: Cory Maccarrone 
Cc: Lee Jones 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/htc-i2cpld.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 01572b5e79e8..af3c66355270 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -27,7 +27,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -614,8 +613,6 @@ static const struct i2c_device_id htcpld_chip_id[] = {
{ "htcpld-chip", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, htcpld_chip_id);
-
 
 static struct i2c_driver htcpld_chip_driver = {
.driver = {
@@ -643,17 +640,4 @@ static int __init htcpld_core_init(void)
/* Probe for our chips */
return platform_driver_probe(_core_driver, htcpld_core_probe);
 }
-
-static void __exit htcpld_core_exit(void)
-{
-   i2c_del_driver(_chip_driver);
-   platform_driver_unregister(_core_driver);
-}
-
-module_init(htcpld_core_init);
-module_exit(htcpld_core_exit);
-
-MODULE_AUTHOR("Cory Maccarrone ");
-MODULE_DESCRIPTION("I2C HTC PLD Driver");
-MODULE_LICENSE("GPL");
-
+device_initcall(htcpld_core_init);
-- 
2.7.4



[PATCH 01/18] mfd: aat2870-core: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AAT2870_CORE
drivers/mfd/Kconfig:bool "AnalogicTech AAT2870"

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Lee Jones 
Cc: Jin Park 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/aat2870-core.c | 40 +++-
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 3ba19a45f199..9d3d90d386c2 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -20,7 +20,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -349,18 +348,10 @@ static void aat2870_init_debugfs(struct aat2870_data 
*aat2870)
 "Failed to create debugfs register file\n");
 }
 
-static void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-   debugfs_remove_recursive(aat2870->dentry_root);
-}
 #else
 static inline void aat2870_init_debugfs(struct aat2870_data *aat2870)
 {
 }
-
-static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
-{
-}
 #endif /* CONFIG_DEBUG_FS */
 
 static int aat2870_i2c_probe(struct i2c_client *client,
@@ -440,20 +431,6 @@ static int aat2870_i2c_probe(struct i2c_client *client,
return ret;
 }
 
-static int aat2870_i2c_remove(struct i2c_client *client)
-{
-   struct aat2870_data *aat2870 = i2c_get_clientdata(client);
-
-   aat2870_uninit_debugfs(aat2870);
-
-   mfd_remove_devices(aat2870->dev);
-   aat2870_disable(aat2870);
-   if (aat2870->uninit)
-   aat2870->uninit(aat2870);
-
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int aat2870_i2c_suspend(struct device *dev)
 {
@@ -492,15 +469,14 @@ static const struct i2c_device_id aat2870_i2c_id_table[] 
= {
{ "aat2870", 0 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, aat2870_i2c_id_table);
 
 static struct i2c_driver aat2870_i2c_driver = {
.driver = {
-   .name   = "aat2870",
-   .pm = _pm_ops,
+   .name   = "aat2870",
+   .pm = _pm_ops,
+   .suppress_bind_attrs= true,
},
.probe  = aat2870_i2c_probe,
-   .remove = aat2870_i2c_remove,
.id_table   = aat2870_i2c_id_table,
 };
 
@@ -509,13 +485,3 @@ static int __init aat2870_init(void)
return i2c_add_driver(_i2c_driver);
 }
 subsys_initcall(aat2870_init);
-
-static void __exit aat2870_exit(void)
-{
-   i2c_del_driver(_i2c_driver);
-}
-module_exit(aat2870_exit);
-
-MODULE_DESCRIPTION("Core support for the AnalogicTech AAT2870");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jin Park ");
-- 
2.7.4



[PATCH 02/18] mfd: adp5520: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Makefile/Kconfig currently controlling compilation of this code is:

drivers/mfd/Makefile:obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
drivers/mfd/Kconfig:config PMIC_ADP5520
drivers/mfd/Kconfig:bool "Analog Devices ADP5520/01 MFD PMIC Core 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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

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
was (or is now) contained at the top of the file in the comments.

Cc: Michael Hennerich 
Cc: Lee Jones 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/adp5520.c | 30 +++---
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index be0497b96720..2cdd39cb8a18 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -7,6 +7,8 @@
  *
  * Copyright 2009 Analog Devices Inc.
  *
+ * Author: Michael Hennerich 
+ *
  * Derived from da903x:
  * Copyright (C) 2008 Compulab, Ltd.
  * Mike Rapoport 
@@ -18,7 +20,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -304,18 +306,6 @@ static int adp5520_probe(struct i2c_client *client,
return ret;
 }
 
-static int adp5520_remove(struct i2c_client *client)
-{
-   struct adp5520_chip *chip = dev_get_drvdata(>dev);
-
-   if (chip->irq)
-   free_irq(chip->irq, chip);
-
-   adp5520_remove_subdevs(chip);
-   adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
@@ -346,20 +336,14 @@ static const struct i2c_device_id adp5520_id[] = {
{ "pmic-adp5501", ID_ADP5501 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, adp5520_id);
 
 static struct i2c_driver adp5520_driver = {
.driver = {
-   .name   = "adp5520",
-   .pm = _pm,
+   .name   = "adp5520",
+   .pm = _pm,
+   .suppress_bind_attrs= true,
},
.probe  = adp5520_probe,
-   .remove = adp5520_remove,
.id_table   = adp5520_id,
 };
-
-module_i2c_driver(adp5520_driver);
-
-MODULE_AUTHOR("Michael Hennerich ");
-MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(adp5520_driver);
-- 
2.7.4



[PATCH 02/18] mfd: adp5520: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
The Makefile/Kconfig currently controlling compilation of this code is:

drivers/mfd/Makefile:obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
drivers/mfd/Kconfig:config PMIC_ADP5520
drivers/mfd/Kconfig:bool "Analog Devices ADP5520/01 MFD PMIC Core 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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

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
was (or is now) contained at the top of the file in the comments.

Cc: Michael Hennerich 
Cc: Lee Jones 
Acked-by: Linus Walleij 
Signed-off-by: Paul Gortmaker 
---
 drivers/mfd/adp5520.c | 30 +++---
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index be0497b96720..2cdd39cb8a18 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -7,6 +7,8 @@
  *
  * Copyright 2009 Analog Devices Inc.
  *
+ * Author: Michael Hennerich 
+ *
  * Derived from da903x:
  * Copyright (C) 2008 Compulab, Ltd.
  * Mike Rapoport 
@@ -18,7 +20,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -304,18 +306,6 @@ static int adp5520_probe(struct i2c_client *client,
return ret;
 }
 
-static int adp5520_remove(struct i2c_client *client)
-{
-   struct adp5520_chip *chip = dev_get_drvdata(>dev);
-
-   if (chip->irq)
-   free_irq(chip->irq, chip);
-
-   adp5520_remove_subdevs(chip);
-   adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
-   return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int adp5520_suspend(struct device *dev)
 {
@@ -346,20 +336,14 @@ static const struct i2c_device_id adp5520_id[] = {
{ "pmic-adp5501", ID_ADP5501 },
{ }
 };
-MODULE_DEVICE_TABLE(i2c, adp5520_id);
 
 static struct i2c_driver adp5520_driver = {
.driver = {
-   .name   = "adp5520",
-   .pm = _pm,
+   .name   = "adp5520",
+   .pm = _pm,
+   .suppress_bind_attrs= true,
},
.probe  = adp5520_probe,
-   .remove = adp5520_remove,
.id_table   = adp5520_id,
 };
-
-module_i2c_driver(adp5520_driver);
-
-MODULE_AUTHOR("Michael Hennerich ");
-MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(adp5520_driver);
-- 
2.7.4



Re: [PATCH 18/22] mfd: wm831x-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
[Re: [PATCH 18/22] mfd: wm831x-i2c: Make it explicitly non-modular] On 
05/12/2018 (Wed 11:38) Charles Keepax wrote:

> On Sun, Dec 02, 2018 at 11:23:25PM -0500, Paul Gortmaker wrote:

[...]

> > -static int wm831x_i2c_remove(struct i2c_client *i2c)
> > -{
> > -   struct wm831x *wm831x = i2c_get_clientdata(i2c);
> > -
> > -   wm831x_device_exit(wm831x);
> 
> These patches remove the only callers of wm831x_device_exit, so I
> guess we should probably remove that function too?

Agreed. I've ammended the 831x-core patch to remove this as well.
Thanks for spotting it.  Will send v3 shortly.

Paul.
--

> 
> Thanks,
> Charles


Re: [PATCH 18/22] mfd: wm831x-i2c: Make it explicitly non-modular

2018-12-07 Thread Paul Gortmaker
[Re: [PATCH 18/22] mfd: wm831x-i2c: Make it explicitly non-modular] On 
05/12/2018 (Wed 11:38) Charles Keepax wrote:

> On Sun, Dec 02, 2018 at 11:23:25PM -0500, Paul Gortmaker wrote:

[...]

> > -static int wm831x_i2c_remove(struct i2c_client *i2c)
> > -{
> > -   struct wm831x *wm831x = i2c_get_clientdata(i2c);
> > -
> > -   wm831x_device_exit(wm831x);
> 
> These patches remove the only callers of wm831x_device_exit, so I
> guess we should probably remove that function too?

Agreed. I've ammended the 831x-core patch to remove this as well.
Thanks for spotting it.  Will send v3 shortly.

Paul.
--

> 
> Thanks,
> Charles


Re: [PATCH v2 00/22] mfd: demodularization of non-modular drivers

2018-12-05 Thread Paul Gortmaker
[RE: [PATCH v2 00/22] mfd: demodularization of non-modular drivers] On 
05/12/2018 (Wed 12:01) Steve Twiss wrote:

> Hi Paul,
> 
> On 03 December 2018 04:23, Paul Gortmaker wrote:
> 
> > Subject: [PATCH v2 00/22] mfd: demodularization of non-modular drivers
> > 
> > [v1 --> v2: add some more commits as requested by Lee (MFD maintainer),
> >  update the 00/NN text; re-do build and link testing on new linux-next. ]
> > 
> > This group of MFD drivers are all controlled by "bool" Kconfig settings,
> > but contain various amounts of largely pointless uses of infrastructure
> > related to modular operations, even though they can't be built modular.
> > 
> > We can easily remove/replace all of it.  We are trying to make driver
> > code consistent with the Makefiles/Kconfigs that control them. 
> 
> For the DA9052 and DA9055, changes:
> 
> -  drivers/mfd/da9052-core.c | 11 ---
> -  drivers/mfd/da9052-i2c.c  | 22 ++---
> -  drivers/mfd/da9052-irq.c  |  1 -
> -  drivers/mfd/da9052-spi.c  | 22 ++---
> -  drivers/mfd/da9055-core.c | 13 ++---
> -  drivers/mfd/da9055-i2c.c  | 24 ++-
> 
> The responsibility can fall back to Dialog for these changes. We will
> submit Kconfig patches for these and make them explicitly non-modular.
> This will remove the ambiguity caused by the Kconfig bool options.

[typo noted: non-modular ---> modular]

Great, I'll look forward to seeing those patches to convert  these
drivers to modular in the near future, and I'll not re-send mine.

Thanks,
P.
--


> 
> Regards,
> Steve
> 
> > This
> > means not using modular functions/macros for drivers that can never be
> > built as a module.  Some of the downfalls this oversight leads to are:
> > 
> >  (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 a lot of CPP overhead.
> >  (4) it gets copied/replicated into other drivers and spreads quickly.
> > 
> > What we see in current drivers falls into one or more of the following
> > categories:
> > 
> > 1) include of  when it simply isn't needed
> > 
> > 2) Use of MODULE_LICENSE, MODULE_DEVICE_TABLE,  MODULE_AUTHOR etc.
> >macros that are no-ops for non-modular drivers.
> > 
> > 3) Creation of a module_exit() function that will be compiled and
> >linked in but never actually called for non-modular drivers.
> > 
> > 4) Addition of a platform_driver ".remove" function that is bound
> >into the struct but will never be called for non-module use cases.
> > 
> > Solution to #1 --> #3 is simple ; we just delete the related code.
> > 
> > The solution to #4 is similar - we delete the ".remove" function and
> > the binding into the platform_driver struct.  However, since the same
> > ".remove" function could also be triggered by an "unbind" (such as for
> > pass-through of a device to a guest instance)  - so we also explicitly
> > disable any unbind for the driver.
> > 
> > The unbind mask allows us to ensure we will see if there was some odd
> > corner case out there that was relying on it.  Typically it would be a
> > multi-port ethernet card passing a port through to a guest, so a
> > sensible use case in MFD drivers seems highly unlikely.  This same
> > solution has already been used in multiple other mainline subsystems.
> > 
> > Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
> > and ARM-64 on a recent linux-next checkout.
> > 
> > Paul.
> > 
> > ---
> > 
> > Cc: Arnd Bergmann 
> > Cc: Cory Maccarrone 
> > Cc: David Dajun Chen 
> > Cc: Dong Aisheng 
> > Cc: Eric Miao 
> > Cc: Graeme Gregory 
> > Cc: Guennadi Liakhovetski 
> > Cc: Haojian Zhuang 
> > Cc: Jin Park 
> > Cc: Jorge Eduardo Candelaria 
> > Cc: Laxman Dewangan 
> > Cc: Lee Jones 
> > Cc: Linus Walleij 
> > Cc: Mark Brown 
> > Cc: Mattias Nilsson 
> > Cc: Michael Hennerich 
> > Cc: Mike Rapoport 
> > Cc: Tony Lindgren 
> > Cc: Venu Byravarasu 
> > Cc: linux-o...@vger.kernel.org
> > Cc: patc...@opensource.cirrus.com
> > Cc: Support Opensource 
> > 
> > 
> > Paul Gortmaker (22):
> >   mfd: aat2870-core: Mak

<    1   2   3   4   5   6   7   8   9   10   >