iio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 1 Apr 2022 14:06:05 +0000 (15:06 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Apr 2022 18:16:34 +0000 (20:16 +0200)
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@huawei.com>
Cc: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/iio/chemical/scd30_core.c
drivers/iio/chemical/scd30_i2c.c
drivers/iio/chemical/scd30_serial.c

index 6c6c11c2772a1297f3eb914a4dac41fb8aa6a895..682fca39d14d63fcbdff3c3c0b2a03e0e0950821 100644 (file)
@@ -543,7 +543,7 @@ static int scd30_resume(struct device *dev)
        return scd30_command_write(state, CMD_START_MEAS, state->pressure_comp);
 }
 
-EXPORT_SIMPLE_DEV_PM_OPS(scd30_pm_ops, scd30_suspend, scd30_resume);
+EXPORT_NS_SIMPLE_DEV_PM_OPS(scd30_pm_ops, scd30_suspend, scd30_resume, IIO_SCD30);
 
 static void scd30_stop_meas(void *data)
 {
@@ -759,7 +759,7 @@ int scd30_probe(struct device *dev, int irq, const char *name, void *priv,
 
        return devm_iio_device_register(dev, indio_dev);
 }
-EXPORT_SYMBOL(scd30_probe);
+EXPORT_SYMBOL_NS(scd30_probe, IIO_SCD30);
 
 MODULE_AUTHOR("Tomasz Duszynski <tomasz.duszynski@octakon.com>");
 MODULE_DESCRIPTION("Sensirion SCD30 carbon dioxide sensor core driver");
index 7c332e4e8e46f694fd554d9e8e6930378349c91e..bae479a4721f3b4977f72da16d7cd31086ba90bb 100644 (file)
@@ -137,3 +137,4 @@ module_i2c_driver(scd30_i2c_driver);
 MODULE_AUTHOR("Tomasz Duszynski <tomasz.duszynski@octakon.com>");
 MODULE_DESCRIPTION("Sensirion SCD30 carbon dioxide sensor i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_SCD30);
index 8664f3ce6b337ddd409810f0f75215aebc9ac498..3c519103d30b54fc664b2751ceb0b90754bc374f 100644 (file)
@@ -261,3 +261,4 @@ module_serdev_device_driver(scd30_serdev_driver);
 MODULE_AUTHOR("Tomasz Duszynski <tomasz.duszynski@octakon.com>");
 MODULE_DESCRIPTION("Sensirion SCD30 carbon dioxide sensor serial driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_SCD30);