Commit ef807729 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the core/library functions into a specific namespace and import
that into the various 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>
Cc: Renato Lui Geh <renatogeh@gmail.com>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-2-jic23@kernel.org
parent 0805b512
...@@ -970,3 +970,4 @@ module_spi_driver(ad71124_driver); ...@@ -970,3 +970,4 @@ module_spi_driver(ad71124_driver);
MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>"); MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7124 SPI driver"); MODULE_DESCRIPTION("Analog Devices AD7124 SPI driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_AD_SIGMA_DELTA);
...@@ -1048,3 +1048,4 @@ module_spi_driver(ad7192_driver); ...@@ -1048,3 +1048,4 @@ module_spi_driver(ad7192_driver);
MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>"); MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7193, AD7195 ADC"); MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7193, AD7195 ADC");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_AD_SIGMA_DELTA);
...@@ -375,3 +375,4 @@ module_spi_driver(ad7780_driver); ...@@ -375,3 +375,4 @@ module_spi_driver(ad7780_driver);
MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>"); MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7780 and similar ADCs"); MODULE_DESCRIPTION("Analog Devices AD7780 and similar ADCs");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_AD_SIGMA_DELTA);
...@@ -474,3 +474,4 @@ module_spi_driver(ad7791_driver); ...@@ -474,3 +474,4 @@ module_spi_driver(ad7791_driver);
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_DESCRIPTION("Analog Devices AD7787/AD7788/AD7789/AD7790/AD7791 ADC driver"); MODULE_DESCRIPTION("Analog Devices AD7787/AD7788/AD7789/AD7790/AD7791 ADC driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_AD_SIGMA_DELTA);
...@@ -867,3 +867,4 @@ module_spi_driver(ad7793_driver); ...@@ -867,3 +867,4 @@ module_spi_driver(ad7793_driver);
MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>"); MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7793 and similar ADCs"); MODULE_DESCRIPTION("Analog Devices AD7793 and similar ADCs");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_AD_SIGMA_DELTA);
...@@ -42,7 +42,7 @@ void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm) ...@@ -42,7 +42,7 @@ void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm)
* to select the channel */ * to select the channel */
sigma_delta->comm = comm & AD_SD_COMM_CHAN_MASK; sigma_delta->comm = comm & AD_SD_COMM_CHAN_MASK;
} }
EXPORT_SYMBOL_GPL(ad_sd_set_comm); EXPORT_SYMBOL_NS_GPL(ad_sd_set_comm, IIO_AD_SIGMA_DELTA);
/** /**
* ad_sd_write_reg() - Write a register * ad_sd_write_reg() - Write a register
...@@ -94,7 +94,7 @@ int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, ...@@ -94,7 +94,7 @@ int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(ad_sd_write_reg); EXPORT_SYMBOL_NS_GPL(ad_sd_write_reg, IIO_AD_SIGMA_DELTA);
static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta, static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,
unsigned int reg, unsigned int size, uint8_t *val) unsigned int reg, unsigned int size, uint8_t *val)
...@@ -171,7 +171,7 @@ int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, ...@@ -171,7 +171,7 @@ int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta,
out: out:
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(ad_sd_read_reg); EXPORT_SYMBOL_NS_GPL(ad_sd_read_reg, IIO_AD_SIGMA_DELTA);
/** /**
* ad_sd_reset() - Reset the serial interface * ad_sd_reset() - Reset the serial interface
...@@ -199,7 +199,7 @@ int ad_sd_reset(struct ad_sigma_delta *sigma_delta, ...@@ -199,7 +199,7 @@ int ad_sd_reset(struct ad_sigma_delta *sigma_delta,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(ad_sd_reset); EXPORT_SYMBOL_NS_GPL(ad_sd_reset, IIO_AD_SIGMA_DELTA);
int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
unsigned int mode, unsigned int channel) unsigned int mode, unsigned int channel)
...@@ -238,7 +238,7 @@ int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta, ...@@ -238,7 +238,7 @@ int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(ad_sd_calibrate); EXPORT_SYMBOL_NS_GPL(ad_sd_calibrate, IIO_AD_SIGMA_DELTA);
/** /**
* ad_sd_calibrate_all() - Performs channel calibration * ad_sd_calibrate_all() - Performs channel calibration
...@@ -262,7 +262,7 @@ int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta, ...@@ -262,7 +262,7 @@ int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ad_sd_calibrate_all); EXPORT_SYMBOL_NS_GPL(ad_sd_calibrate_all, IIO_AD_SIGMA_DELTA);
/** /**
* ad_sigma_delta_single_conversion() - Performs a single data conversion * ad_sigma_delta_single_conversion() - Performs a single data conversion
...@@ -337,7 +337,7 @@ int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev, ...@@ -337,7 +337,7 @@ int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,
return IIO_VAL_INT; return IIO_VAL_INT;
} }
EXPORT_SYMBOL_GPL(ad_sigma_delta_single_conversion); EXPORT_SYMBOL_NS_GPL(ad_sigma_delta_single_conversion, IIO_AD_SIGMA_DELTA);
static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) static int ad_sd_buffer_postenable(struct iio_dev *indio_dev)
{ {
...@@ -465,7 +465,7 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig) ...@@ -465,7 +465,7 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ad_sd_validate_trigger); EXPORT_SYMBOL_NS_GPL(ad_sd_validate_trigger, IIO_AD_SIGMA_DELTA);
static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_dev) static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_dev)
{ {
...@@ -524,7 +524,7 @@ int devm_ad_sd_setup_buffer_and_trigger(struct device *dev, struct iio_dev *indi ...@@ -524,7 +524,7 @@ int devm_ad_sd_setup_buffer_and_trigger(struct device *dev, struct iio_dev *indi
return devm_ad_sd_probe_trigger(dev, indio_dev); return devm_ad_sd_probe_trigger(dev, indio_dev);
} }
EXPORT_SYMBOL_GPL(devm_ad_sd_setup_buffer_and_trigger); EXPORT_SYMBOL_NS_GPL(devm_ad_sd_setup_buffer_and_trigger, IIO_AD_SIGMA_DELTA);
/** /**
* ad_sd_init() - Initializes a ad_sigma_delta struct * ad_sd_init() - Initializes a ad_sigma_delta struct
...@@ -545,7 +545,7 @@ int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, ...@@ -545,7 +545,7 @@ int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ad_sd_init); EXPORT_SYMBOL_NS_GPL(ad_sd_init, IIO_AD_SIGMA_DELTA);
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_DESCRIPTION("Analog Devices Sigma-Delta ADCs"); MODULE_DESCRIPTION("Analog Devices Sigma-Delta ADCs");
......
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