iio: pressure: bmp280: Move symbol exports to IIO_BMP280 namespace
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 4 Jun 2022 15:53:04 +0000 (16:53 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 21 Jun 2022 20:30:31 +0000 (21:30 +0100)
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>
drivers/iio/pressure/bmp280-core.c
drivers/iio/pressure/bmp280-i2c.c
drivers/iio/pressure/bmp280-regmap.c
drivers/iio/pressure/bmp280-spi.c

index bf8167f43c568b3c356036b0ddcef2b89366da1e..fe7aa81e7cc9e535d13e553db4df33467077efcd 100644 (file)
@@ -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)
 {
index 35045bd9284607c7e5f0eb8d13d5fd36edaffff6..bf4a7a6175371d0a5cf59f131814674cdc3cfb7d 100644 (file)
@@ -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);
index da136dbadc8f7e8c7f8af4d91b48903cac86cd67..9696985189840965d576fb8ef8214e4e10d9bf22 100644 (file)
@@ -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);
index 41f6cc56d229e1f4a7f1ccd57f4b54ad2359fe02..4cfaf3e869b8f5c1e8856cefcf238892dbc01261 100644 (file)
@@ -118,3 +118,4 @@ module_spi_driver(bmp280_spi_driver);
 
 MODULE_DESCRIPTION("BMP280 SPI bus driver");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_BMP280);