Commit 7e615caf authored by Jonathan Cameron's avatar Jonathan Cameron

iio:magnetometer:hmc5843: Move exports to IIO_HMC5843 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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-15-jic23@kernel.org
parent 47d6cae0
...@@ -608,14 +608,14 @@ int hmc5843_common_suspend(struct device *dev) ...@@ -608,14 +608,14 @@ int hmc5843_common_suspend(struct device *dev)
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)), return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_SLEEP); HMC5843_MODE_SLEEP);
} }
EXPORT_SYMBOL(hmc5843_common_suspend); EXPORT_SYMBOL_NS(hmc5843_common_suspend, IIO_HMC5843);
int hmc5843_common_resume(struct device *dev) int hmc5843_common_resume(struct device *dev)
{ {
return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)), return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
HMC5843_MODE_CONVERSION_CONTINUOUS); HMC5843_MODE_CONVERSION_CONTINUOUS);
} }
EXPORT_SYMBOL(hmc5843_common_resume); EXPORT_SYMBOL_NS(hmc5843_common_resume, IIO_HMC5843);
int hmc5843_common_probe(struct device *dev, struct regmap *regmap, int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
enum hmc5843_ids id, const char *name) enum hmc5843_ids id, const char *name)
...@@ -669,7 +669,7 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap, ...@@ -669,7 +669,7 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP); hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
return ret; return ret;
} }
EXPORT_SYMBOL(hmc5843_common_probe); EXPORT_SYMBOL_NS(hmc5843_common_probe, IIO_HMC5843);
void hmc5843_common_remove(struct device *dev) void hmc5843_common_remove(struct device *dev)
{ {
...@@ -681,7 +681,7 @@ void hmc5843_common_remove(struct device *dev) ...@@ -681,7 +681,7 @@ void hmc5843_common_remove(struct device *dev)
/* sleep mode to save power */ /* sleep mode to save power */
hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP); hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP);
} }
EXPORT_SYMBOL(hmc5843_common_remove); EXPORT_SYMBOL_NS(hmc5843_common_remove, IIO_HMC5843);
MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com>"); MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com>");
MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 core driver"); MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 core driver");
......
...@@ -105,3 +105,4 @@ module_i2c_driver(hmc5843_driver); ...@@ -105,3 +105,4 @@ module_i2c_driver(hmc5843_driver);
MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>"); MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>");
MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 i2c driver"); MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 i2c driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_HMC5843);
...@@ -102,3 +102,4 @@ module_spi_driver(hmc5843_driver); ...@@ -102,3 +102,4 @@ module_spi_driver(hmc5843_driver);
MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>"); MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>");
MODULE_DESCRIPTION("HMC5983 SPI driver"); MODULE_DESCRIPTION("HMC5983 SPI driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_HMC5843);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment