diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-06-04 16:53:04 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-06-21 21:30:31 +0100 |
commit | 0f26b9db8dfde33184f8afa79845da267bd6cf9f (patch) | |
tree | c537db4b691b66c48cfe46bea726fa2ce4689c29 /drivers | |
parent | 2a8efd8b2941027e9994bdddd12af56226464006 (diff) |
iio: pressure: bmp280: Move symbol exports to IIO_BMP280 namespace
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
Reviewed-By: Joe Simmons-Talbott <joetalbott@gmail.com>
Link: https://lore.kernel.org/r/20220604155306.422937-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/pressure/bmp280-core.c | 2 | ||||
-rw-r--r-- | drivers/iio/pressure/bmp280-i2c.c | 1 | ||||
-rw-r--r-- | drivers/iio/pressure/bmp280-regmap.c | 4 | ||||
-rw-r--r-- | 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); |