linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Gwendal Grignou <gwendal@chromium.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 09/13] iio:accel:bmc150: Move exports into IIO_BMC150 namespace
Date: Sun, 16 Jan 2022 18:05:31 +0000	[thread overview]
Message-ID: <20220116180535.2367780-10-jic23@kernel.org> (raw)
In-Reply-To: <20220116180535.2367780-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

To avoid unnecessary pollution of the global symbol namespace move the
driver core exports into their own namespace and import that into the two
bus modules.

For more info see https://lwn.net/Articles/760045/

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/accel/bmc150-accel-core.c | 8 ++++----
 drivers/iio/accel/bmc150-accel-i2c.c  | 1 +
 drivers/iio/accel/bmc150-accel-spi.c  | 1 +
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index e6081dd0a880..a5e0214b7be6 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -203,7 +203,7 @@ const struct regmap_config bmc150_regmap_conf = {
 	.val_bits = 8,
 	.max_register = 0x3f,
 };
-EXPORT_SYMBOL_GPL(bmc150_regmap_conf);
+EXPORT_SYMBOL_NS_GPL(bmc150_regmap_conf, IIO_BMC150);
 
 static int bmc150_accel_set_mode(struct bmc150_accel_data *data,
 				 enum bmc150_power_modes mode,
@@ -1798,7 +1798,7 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(bmc150_accel_core_probe);
+EXPORT_SYMBOL_NS_GPL(bmc150_accel_core_probe, IIO_BMC150);
 
 void bmc150_accel_core_remove(struct device *dev)
 {
@@ -1821,7 +1821,7 @@ void bmc150_accel_core_remove(struct device *dev)
 	regulator_bulk_disable(ARRAY_SIZE(data->regulators),
 			       data->regulators);
 }
-EXPORT_SYMBOL_GPL(bmc150_accel_core_remove);
+EXPORT_SYMBOL_NS_GPL(bmc150_accel_core_remove, IIO_BMC150);
 
 #ifdef CONFIG_PM_SLEEP
 static int bmc150_accel_suspend(struct device *dev)
@@ -1896,7 +1896,7 @@ const struct dev_pm_ops bmc150_accel_pm_ops = {
 	SET_RUNTIME_PM_OPS(bmc150_accel_runtime_suspend,
 			   bmc150_accel_runtime_resume, NULL)
 };
-EXPORT_SYMBOL_GPL(bmc150_accel_pm_ops);
+EXPORT_SYMBOL_NS_GPL(bmc150_accel_pm_ops, IIO_BMC150);
 
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index 9e52df9a8f07..dff4d7dd101c 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -280,3 +280,4 @@ module_i2c_driver(bmc150_accel_driver);
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BMC150 I2C accelerometer driver");
+MODULE_IMPORT_NS(IIO_BMC150);
diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c
index 11559567cb39..000632c52800 100644
--- a/drivers/iio/accel/bmc150-accel-spi.c
+++ b/drivers/iio/accel/bmc150-accel-spi.c
@@ -84,3 +84,4 @@ module_spi_driver(bmc150_accel_driver);
 MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BMC150 SPI accelerometer driver");
+MODULE_IMPORT_NS(IIO_BMC150);
-- 
2.34.1


  parent reply	other threads:[~2022-01-16 17:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 02/13] iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 03/13] iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 04/13] iio:accel:bma400: Move exports into IIO_BMA400 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 05/13] iio:accel:adxl313: Move exports into IIO_ADXL313 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 06/13] iio:accel:adxl345: Move exports into IIO_ADXL345 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 07/13] iio:accel:adxl355: Move exports into IIO_ADXL355 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 08/13] iio:accel:adxl372: Move exports into IIO_ADXL372 namespace Jonathan Cameron
2022-01-16 18:05 ` Jonathan Cameron [this message]
2022-01-16 18:05 ` [PATCH v2 10/13] iio:accel:bmi088: Move exports into IIO_BMI088 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace Jonathan Cameron
2022-01-31 22:01   ` Sean Nyekjaer
2022-01-16 18:05 ` [PATCH v2 12/13] iio:st-sensors: Remove duplicate MODULE_* Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 13/13] iio:st-sensors: Move exports into IIO_ST_SENSORS namespace Jonathan Cameron
2022-01-30 20:01 ` [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
2022-02-14 10:18   ` Jonathan Cameron
2022-02-14 15:40     ` srinivas pandruvada
2022-02-18 11:37       ` Jonathan Cameron

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=20220116180535.2367780-10-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gwendal@chromium.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.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).