iio: imu: lsm6dsx: Move exported symbols to the IIO_LSM6DSX namespace
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 4 Jun 2022 16:12:23 +0000 (17:12 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 15 Jun 2022 21:07:09 +0000 (22:07 +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/20220220181522.541718-9-jic23@kernel.org
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/20220604161223.461847-6-jic23@kernel.org
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c

index 9e4aa5c1c8d6a88daee860249bf117bcdfb39d8a..6b268f1c5fc3c0bf6d00c1686f7a547b7864b40c 100644 (file)
@@ -2289,7 +2289,7 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
 
        return 0;
 }
-EXPORT_SYMBOL(st_lsm6dsx_probe);
+EXPORT_SYMBOL_NS(st_lsm6dsx_probe, IIO_LSM6DSX);
 
 static int st_lsm6dsx_suspend(struct device *dev)
 {
@@ -2366,8 +2366,8 @@ static int st_lsm6dsx_resume(struct device *dev)
        return err;
 }
 
-EXPORT_SIMPLE_DEV_PM_OPS(st_lsm6dsx_pm_ops, st_lsm6dsx_suspend,
-                        st_lsm6dsx_resume);
+EXPORT_NS_SIMPLE_DEV_PM_OPS(st_lsm6dsx_pm_ops, st_lsm6dsx_suspend,
+                           st_lsm6dsx_resume, IIO_LSM6DSX);
 
 MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@st.com>");
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
index 5bd565b93a8c48640bebfc2ec592ccb3b22bf1de..2ea34c0d3a8cdfe9a8f6a7994a0195056711d29d 100644 (file)
@@ -146,3 +146,4 @@ MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@st.com>");
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_LSM6DSX);
index 4df186499802edd878367156f268c4e32c379aba..3b0c8b19c448168385bebeb7508f5f70402782ef 100644 (file)
@@ -54,3 +54,4 @@ module_i3c_driver(st_lsm6dsx_driver);
 MODULE_AUTHOR("Vitor Soares <vitor.soares@synopsys.com>");
 MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx i3c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_LSM6DSX);
index 3a206fd4d92cbb16868244803ee9e3c294e15703..6a8883f022a8e84dc836b134cad30ea366693ff9 100644 (file)
@@ -146,3 +146,4 @@ MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@st.com>");
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_LSM6DSX);