Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -3
+1 -1
drivers/iio/pressure/bmp280-core.c
··· 1136 1136 1137 1137 return devm_iio_device_register(dev, indio_dev); 1138 1138 } 1139 - EXPORT_SYMBOL(bmp280_common_probe); 1139 + EXPORT_SYMBOL_NS(bmp280_common_probe, IIO_BMP280); 1140 1140 1141 1141 static int bmp280_runtime_suspend(struct device *dev) 1142 1142 {
+1
drivers/iio/pressure/bmp280-i2c.c
··· 68 68 MODULE_AUTHOR("Vlad Dogaru <vlad.dogaru@intel.com>"); 69 69 MODULE_DESCRIPTION("Driver for Bosch Sensortec BMP180/BMP280 pressure and temperature sensor"); 70 70 MODULE_LICENSE("GPL v2"); 71 + MODULE_IMPORT_NS(IIO_BMP280);
+2 -2
drivers/iio/pressure/bmp280-regmap.c
··· 39 39 .writeable_reg = bmp180_is_writeable_reg, 40 40 .volatile_reg = bmp180_is_volatile_reg, 41 41 }; 42 - EXPORT_SYMBOL(bmp180_regmap_config); 42 + EXPORT_SYMBOL_NS(bmp180_regmap_config, IIO_BMP280); 43 43 44 44 static bool bmp280_is_writeable_reg(struct device *dev, unsigned int reg) 45 45 { ··· 82 82 .writeable_reg = bmp280_is_writeable_reg, 83 83 .volatile_reg = bmp280_is_volatile_reg, 84 84 }; 85 - EXPORT_SYMBOL(bmp280_regmap_config); 85 + EXPORT_SYMBOL_NS(bmp280_regmap_config, IIO_BMP280);
+1
drivers/iio/pressure/bmp280-spi.c
··· 118 118 119 119 MODULE_DESCRIPTION("BMP280 SPI bus driver"); 120 120 MODULE_LICENSE("GPL"); 121 + MODULE_IMPORT_NS(IIO_BMP280);