Skip to content

Commit

Permalink
iio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Cameron authored and Rafael J. Wysocki committed Apr 5, 2022
1 parent a8e2512 commit bd8284e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/chemical/scd30_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/chemical/scd30_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions drivers/iio/chemical/scd30_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit bd8284e

Please sign in to comment.