iio:pressure:zpa2326: Move exports into IIO_ZPA2326 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-10-jic23@kernel.org
This commit is contained in:
Jonathan Cameron 2022-01-30 20:56:54 +00:00
parent 6c9304d6af
commit c8629ec92c
3 changed files with 8 additions and 6 deletions

View file

@ -162,7 +162,7 @@ bool zpa2326_isreg_writeable(struct device *dev, unsigned int reg)
return false; return false;
} }
} }
EXPORT_SYMBOL_GPL(zpa2326_isreg_writeable); EXPORT_SYMBOL_NS_GPL(zpa2326_isreg_writeable, IIO_ZPA2326);
bool zpa2326_isreg_readable(struct device *dev, unsigned int reg) bool zpa2326_isreg_readable(struct device *dev, unsigned int reg)
{ {
@ -191,7 +191,7 @@ bool zpa2326_isreg_readable(struct device *dev, unsigned int reg)
return false; return false;
} }
} }
EXPORT_SYMBOL_GPL(zpa2326_isreg_readable); EXPORT_SYMBOL_NS_GPL(zpa2326_isreg_readable, IIO_ZPA2326);
bool zpa2326_isreg_precious(struct device *dev, unsigned int reg) bool zpa2326_isreg_precious(struct device *dev, unsigned int reg)
{ {
@ -204,7 +204,7 @@ bool zpa2326_isreg_precious(struct device *dev, unsigned int reg)
return false; return false;
} }
} }
EXPORT_SYMBOL_GPL(zpa2326_isreg_precious); EXPORT_SYMBOL_NS_GPL(zpa2326_isreg_precious, IIO_ZPA2326);
/** /**
* zpa2326_enable_device() - Enable device, i.e. get out of low power mode. * zpa2326_enable_device() - Enable device, i.e. get out of low power mode.
@ -649,7 +649,7 @@ const struct dev_pm_ops zpa2326_pm_ops = {
SET_RUNTIME_PM_OPS(zpa2326_runtime_suspend, zpa2326_runtime_resume, SET_RUNTIME_PM_OPS(zpa2326_runtime_suspend, zpa2326_runtime_resume,
NULL) NULL)
}; };
EXPORT_SYMBOL_GPL(zpa2326_pm_ops); EXPORT_SYMBOL_NS_GPL(zpa2326_pm_ops, IIO_ZPA2326);
/** /**
* zpa2326_resume() - Request the PM layer to power supply the device. * zpa2326_resume() - Request the PM layer to power supply the device.
@ -1698,7 +1698,7 @@ int zpa2326_probe(struct device *parent,
return err; return err;
} }
EXPORT_SYMBOL_GPL(zpa2326_probe); EXPORT_SYMBOL_NS_GPL(zpa2326_probe, IIO_ZPA2326);
void zpa2326_remove(const struct device *parent) void zpa2326_remove(const struct device *parent)
{ {
@ -1709,7 +1709,7 @@ void zpa2326_remove(const struct device *parent)
zpa2326_sleep(indio_dev); zpa2326_sleep(indio_dev);
zpa2326_power_off(indio_dev, iio_priv(indio_dev)); zpa2326_power_off(indio_dev, iio_priv(indio_dev));
} }
EXPORT_SYMBOL_GPL(zpa2326_remove); EXPORT_SYMBOL_NS_GPL(zpa2326_remove, IIO_ZPA2326);
MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>");
MODULE_DESCRIPTION("Core driver for Murata ZPA2326 pressure sensor"); MODULE_DESCRIPTION("Core driver for Murata ZPA2326 pressure sensor");

View file

@ -87,3 +87,4 @@ module_i2c_driver(zpa2326_i2c_driver);
MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>");
MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor"); MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_ZPA2326);

View file

@ -91,3 +91,4 @@ module_spi_driver(zpa2326_spi_driver);
MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>");
MODULE_DESCRIPTION("SPI driver for Murata ZPA2326 pressure sensor"); MODULE_DESCRIPTION("SPI driver for Murata ZPA2326 pressure sensor");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_ZPA2326);