> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > 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@xxxxxxxxxx> > Link: https://lore.kernel.org/r/20220220181522.541718-9-jic23@xxxxxxxxxx Acked-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx> > --- > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 6 +++--- > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 1 + > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c | 1 + > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c | 1 + > 4 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > index 9e4aa5c1c8d6..6b268f1c5fc3 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > @@ -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@xxxxxx>"); > MODULE_AUTHOR("Denis Ciocca <denis.ciocca@xxxxxx>"); > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c > index 5bd565b93a8c..2ea34c0d3a8c 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c > @@ -146,3 +146,4 @@ MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@xxxxxx>"); > MODULE_AUTHOR("Denis Ciocca <denis.ciocca@xxxxxx>"); > MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx i2c driver"); > MODULE_LICENSE("GPL v2"); > +MODULE_IMPORT_NS(IIO_LSM6DSX); > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c > index 4df186499802..3b0c8b19c448 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c > @@ -54,3 +54,4 @@ module_i3c_driver(st_lsm6dsx_driver); > MODULE_AUTHOR("Vitor Soares <vitor.soares@xxxxxxxxxxxx>"); > MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx i3c driver"); > MODULE_LICENSE("GPL v2"); > +MODULE_IMPORT_NS(IIO_LSM6DSX); > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c > index 3a206fd4d92c..6a8883f022a8 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c > @@ -146,3 +146,4 @@ MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi@xxxxxx>"); > MODULE_AUTHOR("Denis Ciocca <denis.ciocca@xxxxxx>"); > MODULE_DESCRIPTION("STMicroelectronics st_lsm6dsx spi driver"); > MODULE_LICENSE("GPL v2"); > +MODULE_IMPORT_NS(IIO_LSM6DSX); > -- > 2.36.1 >
Attachment:
signature.asc
Description: PGP signature