Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:common:meas-spec: Move exports into IIO_MEAS_SPEC_SENSORS

The obvious choice of ms_sensors felt rather too likely to clash with other
namespaces introduced in future, hence the longer abbreviation.

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>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: William Markezana <william.markezana@meas-spec.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-5-jic23@kernel.org

+16 -12
+12 -12
drivers/iio/common/ms_sensors/ms_sensors_i2c.c
··· 58 58 59 59 return 0; 60 60 } 61 - EXPORT_SYMBOL(ms_sensors_reset); 61 + EXPORT_SYMBOL_NS(ms_sensors_reset, IIO_MEAS_SPEC_SENSORS); 62 62 63 63 /** 64 64 * ms_sensors_read_prom_word() - PROM word read function ··· 84 84 85 85 return 0; 86 86 } 87 - EXPORT_SYMBOL(ms_sensors_read_prom_word); 87 + EXPORT_SYMBOL_NS(ms_sensors_read_prom_word, IIO_MEAS_SPEC_SENSORS); 88 88 89 89 /** 90 90 * ms_sensors_convert_and_read() - ADC conversion & read function ··· 130 130 dev_err(&client->dev, "Unable to make sensor adc conversion\n"); 131 131 return ret; 132 132 } 133 - EXPORT_SYMBOL(ms_sensors_convert_and_read); 133 + EXPORT_SYMBOL_NS(ms_sensors_convert_and_read, IIO_MEAS_SPEC_SENSORS); 134 134 135 135 /** 136 136 * ms_sensors_crc_valid() - CRC check function ··· 248 248 249 249 return 0; 250 250 } 251 - EXPORT_SYMBOL(ms_sensors_read_serial); 251 + EXPORT_SYMBOL_NS(ms_sensors_read_serial, IIO_MEAS_SPEC_SENSORS); 252 252 253 253 static int ms_sensors_read_config_reg(struct i2c_client *client, 254 254 u8 *config_reg) ··· 299 299 MS_SENSORS_CONFIG_REG_WRITE, 300 300 config_reg); 301 301 } 302 - EXPORT_SYMBOL(ms_sensors_write_resolution); 302 + EXPORT_SYMBOL_NS(ms_sensors_write_resolution, IIO_MEAS_SPEC_SENSORS); 303 303 304 304 /** 305 305 * ms_sensors_show_battery_low() - Show device battery low indicator ··· 326 326 327 327 return sysfs_emit(buf, "%d\n", (config_reg & 0x40) >> 6); 328 328 } 329 - EXPORT_SYMBOL(ms_sensors_show_battery_low); 329 + EXPORT_SYMBOL_NS(ms_sensors_show_battery_low, IIO_MEAS_SPEC_SENSORS); 330 330 331 331 /** 332 332 * ms_sensors_show_heater() - Show device heater ··· 353 353 354 354 return sysfs_emit(buf, "%d\n", (config_reg & 0x4) >> 2); 355 355 } 356 - EXPORT_SYMBOL(ms_sensors_show_heater); 356 + EXPORT_SYMBOL_NS(ms_sensors_show_heater, IIO_MEAS_SPEC_SENSORS); 357 357 358 358 /** 359 359 * ms_sensors_write_heater() - Write device heater ··· 401 401 402 402 return len; 403 403 } 404 - EXPORT_SYMBOL(ms_sensors_write_heater); 404 + EXPORT_SYMBOL_NS(ms_sensors_write_heater, IIO_MEAS_SPEC_SENSORS); 405 405 406 406 /** 407 407 * ms_sensors_ht_read_temperature() - Read temperature ··· 442 442 443 443 return 0; 444 444 } 445 - EXPORT_SYMBOL(ms_sensors_ht_read_temperature); 445 + EXPORT_SYMBOL_NS(ms_sensors_ht_read_temperature, IIO_MEAS_SPEC_SENSORS); 446 446 447 447 /** 448 448 * ms_sensors_ht_read_humidity() - Read humidity ··· 485 485 486 486 return 0; 487 487 } 488 - EXPORT_SYMBOL(ms_sensors_ht_read_humidity); 488 + EXPORT_SYMBOL_NS(ms_sensors_ht_read_humidity, IIO_MEAS_SPEC_SENSORS); 489 489 490 490 /** 491 491 * ms_sensors_tp_crc4() - Calculate PROM CRC for ··· 602 602 603 603 return 0; 604 604 } 605 - EXPORT_SYMBOL(ms_sensors_tp_read_prom); 605 + EXPORT_SYMBOL_NS(ms_sensors_tp_read_prom, IIO_MEAS_SPEC_SENSORS); 606 606 607 607 /** 608 608 * ms_sensors_read_temp_and_pressure() - read temp and pressure ··· 688 688 689 689 return 0; 690 690 } 691 - EXPORT_SYMBOL(ms_sensors_read_temp_and_pressure); 691 + EXPORT_SYMBOL_NS(ms_sensors_read_temp_and_pressure, IIO_MEAS_SPEC_SENSORS); 692 692 693 693 MODULE_DESCRIPTION("Measurement-Specialties common i2c driver"); 694 694 MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>");
+1
drivers/iio/humidity/htu21.c
··· 258 258 MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>"); 259 259 MODULE_AUTHOR("Ludovic Tancerel <ludovic.tancerel@maplehightech.com>"); 260 260 MODULE_LICENSE("GPL v2"); 261 + MODULE_IMPORT_NS(IIO_MEAS_SPEC_SENSORS);
+1
drivers/iio/pressure/ms5637.c
··· 252 252 MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>"); 253 253 MODULE_AUTHOR("Ludovic Tancerel <ludovic.tancerel@maplehightech.com>"); 254 254 MODULE_LICENSE("GPL v2"); 255 + MODULE_IMPORT_NS(IIO_MEAS_SPEC_SENSORS);
+1
drivers/iio/temperature/tsys01.c
··· 233 233 MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>"); 234 234 MODULE_AUTHOR("Ludovic Tancerel <ludovic.tancerel@maplehightech.com>"); 235 235 MODULE_LICENSE("GPL v2"); 236 + MODULE_IMPORT_NS(IIO_MEAS_SPEC_SENSORS);
+1
drivers/iio/temperature/tsys02d.c
··· 187 187 MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>"); 188 188 MODULE_AUTHOR("Ludovic Tancerel <ludovic.tancerel@maplehightech.com>"); 189 189 MODULE_LICENSE("GPL v2"); 190 + MODULE_IMPORT_NS(IIO_MEAS_SPEC_SENSORS);