iio:dac:ad5686: Move exports into IIO_AD5686 namespace
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 30 Jan 2022 20:56:52 +0000 (20:56 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 18 Feb 2022 11:42:26 +0000 (11:42 +0000)
Note these are used in the related ad5696-i2c drivers as well as the
more obviously connected ad5686-spi driver.

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 various 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-8-jic23@kernel.org
drivers/iio/dac/ad5686-spi.c
drivers/iio/dac/ad5686.c
drivers/iio/dac/ad5696-i2c.c

index 2628810fdbb1ffc9f8ff7e825b0a51d8b4da87b3..75b54c5ba39f74a49e522046ddd3f1a57738cb60 100644 (file)
@@ -137,3 +137,4 @@ module_spi_driver(ad5686_spi_driver);
 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
 MODULE_DESCRIPTION("Analog Devices AD5686 and similar multi-channel DACs");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_AD5686);
index e592a995f404cbe61a22f25c61b03709d781845d..f78dd3f33199ee652a828e6504403f305b49db35 100644 (file)
@@ -536,7 +536,7 @@ error_disable_reg:
                regulator_disable(st->reg);
        return ret;
 }
-EXPORT_SYMBOL_GPL(ad5686_probe);
+EXPORT_SYMBOL_NS_GPL(ad5686_probe, IIO_AD5686);
 
 void ad5686_remove(struct device *dev)
 {
@@ -547,7 +547,7 @@ void ad5686_remove(struct device *dev)
        if (!IS_ERR(st->reg))
                regulator_disable(st->reg);
 }
-EXPORT_SYMBOL_GPL(ad5686_remove);
+EXPORT_SYMBOL_NS_GPL(ad5686_remove, IIO_AD5686);
 
 MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
 MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC");
index 93f0e0e66c22794fee790c1f1205591cef39b608..762503c1901bedd081f1d806e9a2787ee6570df6 100644 (file)
@@ -125,3 +125,4 @@ module_i2c_driver(ad5686_i2c_driver);
 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
 MODULE_DESCRIPTION("Analog Devices AD5686 and similar multi-channel DACs");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_AD5686);