From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH v2 2/4] iio: pressure: bmp280: Move symbol exports to IIO_BMP280 namespace
Date: Sat, 4 Jun 2022 16:53:04 +0100 [thread overview]
Message-ID: <20220604155306.422937-3-jic23@kernel.org> (raw)
In-Reply-To: <20220604155306.422937-1-jic23@kernel.org>
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.
For more info: https://lwn.net/Articles/760045/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20220220173701.502331-3-jic23@kernel.org
---
drivers/iio/pressure/bmp280-core.c | 2 +-
drivers/iio/pressure/bmp280-i2c.c | 1 +
drivers/iio/pressure/bmp280-regmap.c | 4 ++--
drivers/iio/pressure/bmp280-spi.c | 1 +
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index bf8167f43c56..fe7aa81e7cc9 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -1136,7 +1136,7 @@ int bmp280_common_probe(struct device *dev,
return devm_iio_device_register(dev, indio_dev);
}
-EXPORT_SYMBOL(bmp280_common_probe);
+EXPORT_SYMBOL_NS(bmp280_common_probe, IIO_BMP280);
static int bmp280_runtime_suspend(struct device *dev)
{
diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index 35045bd92846..bf4a7a617537 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -68,3 +68,4 @@ module_i2c_driver(bmp280_i2c_driver);
MODULE_AUTHOR("Vlad Dogaru <vlad.dogaru@intel.com>");
MODULE_DESCRIPTION("Driver for Bosch Sensortec BMP180/BMP280 pressure and temperature sensor");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_BMP280);
diff --git a/drivers/iio/pressure/bmp280-regmap.c b/drivers/iio/pressure/bmp280-regmap.c
index da136dbadc8f..969698518984 100644
--- a/drivers/iio/pressure/bmp280-regmap.c
+++ b/drivers/iio/pressure/bmp280-regmap.c
@@ -39,7 +39,7 @@ const struct regmap_config bmp180_regmap_config = {
.writeable_reg = bmp180_is_writeable_reg,
.volatile_reg = bmp180_is_volatile_reg,
};
-EXPORT_SYMBOL(bmp180_regmap_config);
+EXPORT_SYMBOL_NS(bmp180_regmap_config, IIO_BMP280);
static bool bmp280_is_writeable_reg(struct device *dev, unsigned int reg)
{
@@ -82,4 +82,4 @@ const struct regmap_config bmp280_regmap_config = {
.writeable_reg = bmp280_is_writeable_reg,
.volatile_reg = bmp280_is_volatile_reg,
};
-EXPORT_SYMBOL(bmp280_regmap_config);
+EXPORT_SYMBOL_NS(bmp280_regmap_config, IIO_BMP280);
diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c
index 41f6cc56d229..4cfaf3e869b8 100644
--- a/drivers/iio/pressure/bmp280-spi.c
+++ b/drivers/iio/pressure/bmp280-spi.c
@@ -118,3 +118,4 @@ module_spi_driver(bmp280_spi_driver);
MODULE_DESCRIPTION("BMP280 SPI bus driver");
MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_BMP280);
--
2.36.1
next prev parent reply other threads:[~2022-06-04 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-04 15:53 [PATCH v2 0/4] 3rd set of IIO export namespaces Jonathan Cameron
2022-06-04 15:53 ` [PATCH v2 1/4] iio: imu: bmi160: Move exported symbols to IIO_BMI160 namespace Jonathan Cameron
2022-06-04 15:53 ` Jonathan Cameron [this message]
2022-06-04 15:53 ` [PATCH v2 3/4] iio: chemical: sps30: Move symbol exports into IIO_SPS30 namespace Jonathan Cameron
2022-06-04 15:53 ` [PATCH v2 4/4] iio: adc: qcom-vadc: Move symbol exports to IIO_QCOM_VADC namespace Jonathan Cameron
2022-07-01 10:15 ` Jonathan Cameron
2022-06-18 13:20 ` [PATCH v2 0/4] 3rd set of IIO export namespaces Jonathan Cameron
2022-06-21 3:37 ` Joe Simmons-Talbott
2022-06-21 20:31 ` 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=20220604155306.422937-3-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).