linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: <linux-kernel@vger.kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Support Opensource <support.opensource@diasemi.com>,
	David Dajun Chen <dchen@diasemi.com>
Subject: [PATCH 05/22] mfd: da9052-*: Make it explicitly non-modular
Date: Sun, 2 Dec 2018 23:23:12 -0500	[thread overview]
Message-ID: <1543811009-15112-6-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1543811009-15112-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfigis currently controlling compilation of this code are:

mfd/Kconfig:config MFD_DA9052_SPI
mfd/Kconfig:    bool "Dialog Semiconductor DA9052/53 PMIC variants with SPI"

mfd/Kconfig:config MFD_DA9052_I2C
mfd/Kconfig:    bool "Dialog Semiconductor DA9052/53 PMIC variants with I2C"

drivers/mfd/Kconfig:config PMIC_DA9052
drivers/mfd/Kconfig:    bool

...meaning that this code is currently not being built as a module.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
In doing so, da9052_device_exit() becomes orphaned, so it gets
removed as well.

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 replace module.h with init.h where required, i.e. if the the file
did not include that already.

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

Cc: Support Opensource <support.opensource@diasemi.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/da9052-core.c         | 11 -----------
 drivers/mfd/da9052-i2c.c          | 22 ++--------------------
 drivers/mfd/da9052-irq.c          |  1 -
 drivers/mfd/da9052-spi.c          | 22 ++--------------------
 include/linux/mfd/da9052/da9052.h |  1 -
 5 files changed, 4 insertions(+), 53 deletions(-)

diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
index 433add43a0a9..96da73ce5ae4 100644
--- a/drivers/mfd/da9052-core.c
+++ b/drivers/mfd/da9052-core.c
@@ -17,7 +17,6 @@
 #include <linux/interrupt.h>
 #include <linux/mfd/core.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/property.h>
 
 #include <linux/mfd/da9052/da9052.h>
@@ -648,13 +647,3 @@ int da9052_device_init(struct da9052 *da9052, u8 chip_id)
 
 	return ret;
 }
-
-void da9052_device_exit(struct da9052 *da9052)
-{
-	mfd_remove_devices(da9052->dev);
-	da9052_irq_exit(da9052);
-}
-
-MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
-MODULE_DESCRIPTION("DA9052 MFD Core");
-MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 578e881067a5..cf881907b4b3 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -13,7 +13,7 @@
  */
 
 #include <linux/device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/input.h>
 #include <linux/mfd/core.h>
 #include <linux/i2c.h>
@@ -177,20 +177,12 @@ static int da9052_i2c_probe(struct i2c_client *client,
 	return da9052_device_init(da9052, id->driver_data);
 }
 
-static int da9052_i2c_remove(struct i2c_client *client)
-{
-	struct da9052 *da9052 = i2c_get_clientdata(client);
-
-	da9052_device_exit(da9052);
-	return 0;
-}
-
 static struct i2c_driver da9052_i2c_driver = {
 	.probe = da9052_i2c_probe,
-	.remove = da9052_i2c_remove,
 	.id_table = da9052_i2c_id,
 	.driver = {
 		.name = "da9052",
+		.suppress_bind_attrs = true,
 #ifdef CONFIG_OF
 		.of_match_table = dialog_dt_ids,
 #endif
@@ -210,13 +202,3 @@ static int __init da9052_i2c_init(void)
 	return 0;
 }
 subsys_initcall(da9052_i2c_init);
-
-static void __exit da9052_i2c_exit(void)
-{
-	i2c_del_driver(&da9052_i2c_driver);
-}
-module_exit(da9052_i2c_exit);
-
-MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
-MODULE_DESCRIPTION("I2C driver for Dialog DA9052 PMIC");
-MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/da9052-irq.c b/drivers/mfd/da9052-irq.c
index cd4ca849ca44..6e0db46f71a9 100644
--- a/drivers/mfd/da9052-irq.c
+++ b/drivers/mfd/da9052-irq.c
@@ -20,7 +20,6 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 
 #include <linux/mfd/da9052/da9052.h>
 #include <linux/mfd/da9052/reg.h>
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c
index fdae1288bc6d..8532afa567a1 100644
--- a/drivers/mfd/da9052-spi.c
+++ b/drivers/mfd/da9052-spi.c
@@ -13,7 +13,7 @@
  */
 
 #include <linux/device.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/input.h>
 #include <linux/mfd/core.h>
 #include <linux/spi/spi.h>
@@ -60,14 +60,6 @@ static int da9052_spi_probe(struct spi_device *spi)
 	return da9052_device_init(da9052, id->driver_data);
 }
 
-static int da9052_spi_remove(struct spi_device *spi)
-{
-	struct da9052 *da9052 = spi_get_drvdata(spi);
-
-	da9052_device_exit(da9052);
-	return 0;
-}
-
 static const struct spi_device_id da9052_spi_id[] = {
 	{"da9052", DA9052},
 	{"da9053-aa", DA9053_AA},
@@ -79,10 +71,10 @@ static const struct spi_device_id da9052_spi_id[] = {
 
 static struct spi_driver da9052_spi_driver = {
 	.probe = da9052_spi_probe,
-	.remove = da9052_spi_remove,
 	.id_table = da9052_spi_id,
 	.driver = {
 		.name = "da9052",
+		.suppress_bind_attrs = true,
 	},
 };
 
@@ -99,13 +91,3 @@ static int __init da9052_spi_init(void)
 	return 0;
 }
 subsys_initcall(da9052_spi_init);
-
-static void __exit da9052_spi_exit(void)
-{
-	spi_unregister_driver(&da9052_spi_driver);
-}
-module_exit(da9052_spi_exit);
-
-MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
-MODULE_DESCRIPTION("SPI driver for Dialog DA9052 PMIC");
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h
index ae5b663836d0..7951642e2ba0 100644
--- a/include/linux/mfd/da9052/da9052.h
+++ b/include/linux/mfd/da9052/da9052.h
@@ -215,7 +215,6 @@ static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
 }
 
 int da9052_device_init(struct da9052 *da9052, u8 chip_id);
-void da9052_device_exit(struct da9052 *da9052);
 
 extern const struct regmap_config da9052_regmap_config;
 
-- 
2.7.4


  parent reply	other threads:[~2018-12-03  4:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  4:23 [PATCH v2 00/22] mfd: demodularization of non-modular drivers Paul Gortmaker
2018-12-03  4:23 ` [PATCH 01/22] mfd: aat2870-core: Make it explicitly non-modular Paul Gortmaker
2018-12-03  4:23 ` [PATCH 02/22] mfd: adp5520: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 03/22] mfd: as3711: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 04/22] mfd: da903x: " Paul Gortmaker
2018-12-03  4:23 ` Paul Gortmaker [this message]
2018-12-03  4:23 ` [PATCH 06/22] mfd: da9055-i2c: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 07/22] mfd: da9055-core: make " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 08/22] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-12-07 12:25   ` Linus Walleij
2018-12-03  4:23 ` [PATCH 09/22] mfd: htc-i2cpld: Make it explicitly non-modular Paul Gortmaker
2018-12-03  4:23 ` [PATCH 10/22] mfd: max8925-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-12-03  4:23 ` [PATCH 11/22] mfd: rc5t583: Make it explicitly non-modular Paul Gortmaker
2018-12-03  4:23 ` [PATCH 12/22] mfd: sta2x11: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-12-03 11:14   ` Lee Jones
2018-12-03 15:07     ` Paul Gortmaker
2018-12-04  9:23       ` Davide Ciminaghi
2018-12-07 16:39     ` Alessandro Rubini
2018-12-03  4:23 ` [PATCH 13/22] mfd: syscon: Make it explicitly non-modular Paul Gortmaker
2018-12-03  4:23 ` [PATCH 14/22] mfd: tps65090: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 15/22] mfd: tps65910: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 16/22] mfd: tps80031: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 17/22] mfd: wm831x-spi: " Paul Gortmaker
2018-12-03  4:23 ` [PATCH 18/22] mfd: wm831x-i2c: " Paul Gortmaker
2018-12-05 11:38   ` Charles Keepax
2018-12-07 18:16     ` Paul Gortmaker
2018-12-03  4:23 ` [PATCH 19/22] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-12-05 11:36   ` Charles Keepax
2018-12-03  4:23 ` [PATCH 20/22] mfd: wm8350-i2c: Make it explicitly non-modular Paul Gortmaker
2018-12-05 11:39   ` Charles Keepax
2018-12-03  4:23 ` [PATCH 21/22] mfd: wm8350-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-12-05 11:39   ` Charles Keepax
2018-12-03  4:23 ` [PATCH 22/22] mfd: wm8400-core: Make it explicitly non-modular Paul Gortmaker
2018-12-05 11:41   ` Charles Keepax
2018-12-05 11:35 ` [PATCH v2 00/22] mfd: demodularization of non-modular drivers Charles Keepax
2018-12-05 11:48   ` Linus Walleij
2018-12-05 13:40     ` Charles Keepax
2018-12-05 11:50 ` Linus Walleij
2018-12-05 12:01 ` Steve Twiss
2018-12-05 12:12   ` Steve Twiss
2018-12-05 18:08   ` Paul Gortmaker
     [not found]   ` <20181207203021.GR23156@windriver.com>
2019-08-07 10:43     ` Steve Twiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543811009-15112-6-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=dchen@diasemi.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).