IIO: accel/st-sensors move into separate symbol namespaces
Subsystems (6)
Jonathan Cameron
maintainerv2 cover IIO: accel/st-sensors move into separate symbol namespaces
From: Jonathan Cameron <[email protected]>
Changes since v1:
* Add IIO_ prefix to namespaces.
https://lwn.net/Articles/760045/ provides a good overview of this feature and why it might be used. In this particular case we fall under the multi module case. For each group of modules, I've moved the exports into an independent namespace.
Whilst I'm not entirely sure it is worth the noise of moving the main IIO exports into a namespace, it is definitely worthwhile for these small clusters of related modules (typically a core + i2c and spi modules).
I've just done those within drivers/accel (including all of st-sensors as I did not want to do that piecemeal) as an initial set to get feedback on what people think of the approach and in particular naming of the namespaces.
As you can see it is a straight forward change to makes so I'll do the rest of the IIO drivers once we are agreed on the generic details. Note that I'll be expecting this for any new cases of this pattern going forwards.
Includes a small diversion in st-sensors where we had a bunch of duplicated MODULE_* macros for some of the core modules which were made up of multiple c files.
Jonathan Cameron (13):
iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace iio:accel:bma400: Move exports into IIO_BMA400 namespace iio:accel:adxl313: Move exports into IIO_ADXL313 namespace iio:accel:adxl345: Move exports into IIO_ADXL345 namespace iio:accel:adxl355: Move exports into IIO_ADXL355 namespace iio:accel:adxl372: Move exports into IIO_ADXL372 namespace iio:accel:bmc150: Move exports into IIO_BMC150 namespace iio:accel:bmi088: Move exports into IIO_BMI088 namespace iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace iio:st-sensors: Remove duplicate MODULE_* iio:st-sensors: Move exports into IIO_ST_SENSORS namespace
drivers/iio/accel/adxl313_core.c | 6 ++-- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + drivers/iio/accel/adxl355_core.c | 6 ++-- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + drivers/iio/accel/adxl372.c | 4 +-- drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + drivers/iio/accel/bma400_core.c | 6 ++-- drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + drivers/iio/accel/bmc150-accel-core.c | 8 ++--- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + drivers/iio/accel/bmi088-accel-core.c | 8 ++--- drivers/iio/accel/bmi088-accel-spi.c | 1 + drivers/iio/accel/fxls8962af-core.c | 6 ++-- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 ++-- drivers/iio/accel/mma7455_core.c | 6 ++-- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 +++++++++---------- drivers/iio/accel/mma9553.c | 1 + drivers/iio/accel/st_accel_buffer.c | 5 --- drivers/iio/accel/st_accel_core.c | 5 +-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 + .../iio/common/st_sensors/st_sensors_buffer.c | 7 +--- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++-------- .../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 9 ++--- drivers/iio/gyro/st_gyro_buffer.c | 4 --- drivers/iio/gyro/st_gyro_core.c | 5 +-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_buffer.c | 4 --- drivers/iio/magnetometer/st_magn_core.c | 5 +-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_buffer.c | 5 --- drivers/iio/pressure/st_pressure_core.c | 5 +-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 + 56 files changed, 111 insertions(+), 103 deletions(-)
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 1/13 iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace
From: Jonathan Cameron <[email protected]>
In order to avoid unnecessary pollution of the global symbol namespace move the core mma9551 functions into an mma9551 specific namespace.
For more information see https://lwn.net/Articles/760045/
--- drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 ++++++++++++++++---------------- drivers/iio/accel/mma9553.c | 1 + 3 files changed, 20 insertions(+), 18 deletions(-)
drivers/iio/accel/mma9551.c +1 -0
@@ -622,3 +622,4 @@ MODULE_AUTHOR("Irina Tirdea <[email protected]>");MODULE_AUTHOR ("Vlad Dogaru <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("MMA9551L motion-sensing platform driver" ); +MODULE_IMPORT_NS (IIO_MMA9551 );
drivers/iio/accel/mma9551_core.c +18 -18
@@ -219,7 +219,7 @@ int mma9551_read_config_byte(struct i2c_client *client, u8 app_id,return mma9551_transfer (client, app_id,MMA9551_CMD_READ_CONFIG , reg,NULL ,0 , val,1 ); } -EXPORT_SYMBOL (mma9551_read_config_byte); +EXPORT_SYMBOL_NS (mma9551_read_config_byte,IIO_MMA9551 );/** * mma9551_write_config_byte() - write 1 configuration byte
@@ -244,7 +244,7 @@ int mma9551_write_config_byte(struct i2c_client *client, u8 app_id,return mma9551_transfer (client, app_id,MMA9551_CMD_WRITE_CONFIG , reg, &val,1 ,NULL ,0 ); } -EXPORT_SYMBOL (mma9551_write_config_byte); +EXPORT_SYMBOL_NS (mma9551_write_config_byte,IIO_MMA9551 );/** * mma9551_read_status_byte() - read 1 status byte
@@ -269,7 +269,7 @@ int mma9551_read_status_byte(struct i2c_client *client, u8 app_id,return mma9551_transfer (client, app_id,MMA9551_CMD_READ_STATUS , reg,NULL ,0 , val,1 ); } -EXPORT_SYMBOL (mma9551_read_status_byte); +EXPORT_SYMBOL_NS (mma9551_read_status_byte,IIO_MMA9551 );/** * mma9551_read_config_word() - read 1 config word
@@ -300,7 +300,7 @@ int mma9551_read_config_word(struct i2c_client *client, u8 app_id,return ret; } -EXPORT_SYMBOL (mma9551_read_config_word); +EXPORT_SYMBOL_NS (mma9551_read_config_word,IIO_MMA9551 );/** * mma9551_write_config_word() - write 1 config word
@@ -327,7 +327,7 @@ int mma9551_write_config_word(struct i2c_client *client, u8 app_id,return mma9551_transfer (client, app_id,MMA9551_CMD_WRITE_CONFIG , reg, (u8 *)&v,2 ,NULL ,0 ); } -EXPORT_SYMBOL (mma9551_write_config_word); +EXPORT_SYMBOL_NS (mma9551_write_config_word,IIO_MMA9551 );/** * mma9551_read_status_word() - read 1 status word
@@ -358,7 +358,7 @@ int mma9551_read_status_word(struct i2c_client *client, u8 app_id,return ret; } -EXPORT_SYMBOL (mma9551_read_status_word); +EXPORT_SYMBOL_NS (mma9551_read_status_word,IIO_MMA9551 );/** * mma9551_read_config_words() - read multiple config words
@@ -397,7 +397,7 @@ int mma9551_read_config_words(struct i2c_client *client, u8 app_id,return 0 ; } -EXPORT_SYMBOL (mma9551_read_config_words); +EXPORT_SYMBOL_NS (mma9551_read_config_words,IIO_MMA9551 );/** * mma9551_read_status_words() - read multiple status words
@@ -436,7 +436,7 @@ int mma9551_read_status_words(struct i2c_client *client, u8 app_id,return 0 ; } -EXPORT_SYMBOL (mma9551_read_status_words); +EXPORT_SYMBOL_NS (mma9551_read_status_words,IIO_MMA9551 );/** * mma9551_write_config_words() - write multiple config words
@@ -471,7 +471,7 @@ int mma9551_write_config_words(struct i2c_client *client, u8 app_id,return mma9551_transfer (client, app_id,MMA9551_CMD_WRITE_CONFIG , reg, (u8 *)be_buf, len *sizeof (u16),NULL ,0 ); } -EXPORT_SYMBOL (mma9551_write_config_words); +EXPORT_SYMBOL_NS (mma9551_write_config_words,IIO_MMA9551 );/** * mma9551_update_config_bits() - update bits in register
@@ -507,7 +507,7 @@ int mma9551_update_config_bits(struct i2c_client *client, u8 app_id,return mma9551_write_config_byte (client, app_id, reg, tmp); } -EXPORT_SYMBOL (mma9551_update_config_bits); +EXPORT_SYMBOL_NS (mma9551_update_config_bits,IIO_MMA9551 );/** * mma9551_gpio_config() - configure gpio
@@ -586,7 +586,7 @@ int mma9551_gpio_config(struct i2c_client *client, enum mma9551_gpio_pin pin,return ret; } -EXPORT_SYMBOL (mma9551_gpio_config); +EXPORT_SYMBOL_NS (mma9551_gpio_config,IIO_MMA9551 );/** * mma9551_read_version() - read device version information
@@ -616,7 +616,7 @@ int mma9551_read_version(struct i2c_client *client)return 0 ; } -EXPORT_SYMBOL (mma9551_read_version); +EXPORT_SYMBOL_NS (mma9551_read_version,IIO_MMA9551 );/** * mma9551_set_device_state() - sets HW power mode
@@ -646,7 +646,7 @@ int mma9551_set_device_state(struct i2c_client *client, bool enable) MMA9551_SLEEP_CFG_FLEEN : MMA9551_SLEEP_CFG_SNCEN); } -EXPORT_SYMBOL (mma9551_set_device_state); +EXPORT_SYMBOL_NS (mma9551_set_device_state,IIO_MMA9551 );/** * mma9551_set_power_state() - sets runtime PM state
@@ -680,7 +680,7 @@ int mma9551_set_power_state(struct i2c_client *client, bool on)return 0 ; } -EXPORT_SYMBOL (mma9551_set_power_state); +EXPORT_SYMBOL_NS (mma9551_set_power_state,IIO_MMA9551 );/** * mma9551_sleep() - sleep
@@ -699,7 +699,7 @@ void mma9551_sleep(int freq)else msleep_interruptible (sleep_val); } -EXPORT_SYMBOL (mma9551_sleep); +EXPORT_SYMBOL_NS (mma9551_sleep,IIO_MMA9551 );/** * mma9551_read_accel_chan() - read accelerometer channel
@@ -755,7 +755,7 @@ int mma9551_read_accel_chan(struct i2c_client *client,mma9551_set_power_state (client, false);return ret; } -EXPORT_SYMBOL (mma9551_read_accel_chan); +EXPORT_SYMBOL_NS (mma9551_read_accel_chan,IIO_MMA9551 );/** * mma9551_read_accel_scale() - read accelerometer scale
@@ -773,7 +773,7 @@ int mma9551_read_accel_scale(int *val, int *val2)return IIO_VAL_INT_PLUS_MICRO ; } -EXPORT_SYMBOL (mma9551_read_accel_scale); +EXPORT_SYMBOL_NS (mma9551_read_accel_scale,IIO_MMA9551 );/** * mma9551_app_reset() - reset application
@@ -792,7 +792,7 @@ int mma9551_app_reset(struct i2c_client *client, u32 app_mask)MMA9551_RSC_OFFSET (app_mask), MMA9551_RSC_VAL(app_mask)); } -EXPORT_SYMBOL (mma9551_app_reset); +EXPORT_SYMBOL_NS (mma9551_app_reset,IIO_MMA9551 );MODULE_AUTHOR ("Irina Tirdea <[email protected]>" );MODULE_AUTHOR ("Vlad Dogaru <[email protected]>" );
drivers/iio/accel/mma9553.c +1 -0
@@ -1260,3 +1260,4 @@ module_i2c_driver(mma9553_driver);MODULE_AUTHOR ("Irina Tirdea <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("MMA9553L pedometer platform driver" ); +MODULE_IMPORT_NS (IIO_MMA9551 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 2/13 iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In order to avoid unnecessary pollution of the global symbol namespace move the core mma7455 functions into an mma7455 specific namespace and import that into the two bus modules.
For more information see https://lwn.net/Articles/760045/
--- drivers/iio/accel/mma7455_core.c | 6 +++--- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/mma7455_core.c +3 -3
@@ -238,7 +238,7 @@ const struct regmap_config mma7455_core_regmap = { .val_bits = 8, .max_register = MMA7455_REG_TW, }; -EXPORT_SYMBOL_GPL (mma7455_core_regmap); +EXPORT_SYMBOL_NS_GPL (mma7455_core_regmap,IIO_MMA7455 );int mma7455_core_probe (struct device *dev,struct regmap *regmap,const char *name)
@@ -293,7 +293,7 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap,return 0 ; } -EXPORT_SYMBOL_GPL (mma7455_core_probe); +EXPORT_SYMBOL_NS_GPL (mma7455_core_probe,IIO_MMA7455 );void mma7455_core_remove (struct device *dev) {
@@ -306,7 +306,7 @@ void mma7455_core_remove(struct device *dev)regmap_write (mma7455->regmap,MMA7455_REG_MCTL ,MMA7455_MCTL_MODE_STANDBY ); } -EXPORT_SYMBOL_GPL (mma7455_core_remove); +EXPORT_SYMBOL_NS_GPL (mma7455_core_remove,IIO_MMA7455 );MODULE_AUTHOR ("Joachim Eastwood <[email protected]>" );MODULE_DESCRIPTION ("Freescale MMA7455L core accelerometer driver" );
drivers/iio/accel/mma7455_i2c.c +1 -0
@@ -61,3 +61,4 @@ module_i2c_driver(mma7455_i2c_driver);MODULE_AUTHOR ("Joachim Eastwood <[email protected]>" );MODULE_DESCRIPTION ("Freescale MMA7455L I2C accelerometer driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_MMA7455 );
drivers/iio/accel/mma7455_spi.c +1 -0
@@ -49,3 +49,4 @@ module_spi_driver(mma7455_spi_driver);MODULE_AUTHOR ("Joachim Eastwood <[email protected]>" );MODULE_DESCRIPTION ("Freescale MMA7455L SPI accelerometer driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_MMA7455 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 3/13 iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In order to avoid unnecessary pollution of the global symbol namespace move the core kxsd9 functions into a kxsd9 specific namespace and import that into the two bus modules.
For more information see https://lwn.net/Articles/760045/
--- drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/kxsd9-i2c.c +1 -0
@@ -65,3 +65,4 @@ module_i2c_driver(kxsd9_i2c_driver);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("KXSD9 accelerometer I2C interface" ); +MODULE_IMPORT_NS (IIO_KXSD9 );
drivers/iio/accel/kxsd9-spi.c +1 -0
@@ -66,3 +66,4 @@ module_spi_driver(kxsd9_spi_driver);MODULE_AUTHOR ("Jonathan Cameron <[email protected]>" );MODULE_DESCRIPTION ("Kionix KXSD9 SPI driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_KXSD9 );
drivers/iio/accel/kxsd9.c +3 -3
@@ -476,7 +476,7 @@ int kxsd9_common_probe(struct device *dev,return ret; } -EXPORT_SYMBOL (kxsd9_common_probe); +EXPORT_SYMBOL_NS (kxsd9_common_probe,IIO_KXSD9 );void kxsd9_common_remove (struct device *dev) {
@@ -490,7 +490,7 @@ void kxsd9_common_remove(struct device *dev)pm_runtime_disable (dev);kxsd9_power_down (st); } -EXPORT_SYMBOL (kxsd9_common_remove); +EXPORT_SYMBOL_NS (kxsd9_common_remove,IIO_KXSD9 );#ifdef CONFIG_PM static int kxsd9_runtime_suspend (struct device *dev)
@@ -516,7 +516,7 @@ const struct dev_pm_ops kxsd9_dev_pm_ops = {SET_RUNTIME_PM_OPS (kxsd9_runtime_suspend, kxsd9_runtime_resume, NULL) }; -EXPORT_SYMBOL (kxsd9_dev_pm_ops); +EXPORT_SYMBOL_NS (kxsd9_dev_pm_ops,IIO_KXSD9 );MODULE_AUTHOR ("Jonathan Cameron <[email protected]>" );MODULE_DESCRIPTION ("Kionix KXSD9 driver" );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 4/13 iio:accel:bma400: Move exports into IIO_BMA400 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In order to avoid unnecessary pollution of the global symbol namespace move the core bma400 functions into a bma400 specific namespace and import that into the two bus modules.
--- drivers/iio/accel/bma400_core.c | 6 +++--- drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/bma400_core.c +3 -3
@@ -136,7 +136,7 @@ const struct regmap_config bma400_regmap_config = { .writeable_reg = bma400_is_writable_reg, .volatile_reg = bma400_is_volatile_reg, }; -EXPORT_SYMBOL (bma400_regmap_config); +EXPORT_SYMBOL_NS (bma400_regmap_config,IIO_BMA400 );static const struct iio_mount_matrix * bma400_accel_get_mount_matrix(const struct iio_dev *indio_dev,
@@ -826,7 +826,7 @@ int bma400_probe(struct device *dev, struct regmap *regmap, const char *name)return iio_device_register (indio_dev); } -EXPORT_SYMBOL (bma400_probe); +EXPORT_SYMBOL_NS (bma400_probe,IIO_BMA400 );void bma400_remove (struct device *dev) {
@@ -846,7 +846,7 @@ void bma400_remove(struct device *dev)iio_device_unregister (indio_dev); } -EXPORT_SYMBOL (bma400_remove); +EXPORT_SYMBOL_NS (bma400_remove,IIO_BMA400 );MODULE_AUTHOR ("Dan Robertson <[email protected]>" );MODULE_DESCRIPTION ("Bosch BMA400 triaxial acceleration sensor core" );
drivers/iio/accel/bma400_i2c.c +1 -0
@@ -61,3 +61,4 @@ module_i2c_driver(bma400_i2c_driver);MODULE_AUTHOR ("Dan Robertson <[email protected]>" );MODULE_DESCRIPTION ("Bosch BMA400 triaxial acceleration sensor (I2C)" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IIO_BMA400 );
drivers/iio/accel/bma400_spi.c +1 -0
@@ -120,3 +120,4 @@ module_spi_driver(bma400_spi_driver);MODULE_AUTHOR ("Dan Robertson <[email protected]>" );MODULE_DESCRIPTION ("Bosch BMA400 triaxial acceleration sensor (SPI)" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IIO_BMA400 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 5/13 iio:accel:adxl313: Move exports into IIO_ADXL313 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In order to avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
--- drivers/iio/accel/adxl313_core.c | 6 +++--- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/adxl313_core.c +3 -3
@@ -26,7 +26,7 @@ const struct regmap_access_table adxl313_readable_regs_table = { .yes_ranges = adxl313_readable_reg_range, .n_yes_ranges = ARRAY_SIZE(adxl313_readable_reg_range), }; -EXPORT_SYMBOL_GPL (adxl313_readable_regs_table); +EXPORT_SYMBOL_NS_GPL (adxl313_readable_regs_table,IIO_ADXL313 );static const struct regmap_range adxl313_writable_reg_range[] = {regmap_reg_range (ADXL313_REG_SOFT_RESET ,ADXL313_REG_SOFT_RESET ),
@@ -41,7 +41,7 @@ const struct regmap_access_table adxl313_writable_regs_table = { .yes_ranges = adxl313_writable_reg_range, .n_yes_ranges = ARRAY_SIZE(adxl313_writable_reg_range), }; -EXPORT_SYMBOL_GPL (adxl313_writable_regs_table); +EXPORT_SYMBOL_NS_GPL (adxl313_writable_regs_table,IIO_ADXL313 );struct adxl313_data {struct regmap *regmap;
@@ -325,7 +325,7 @@ int adxl313_core_probe(struct device *dev,return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (adxl313_core_probe); +EXPORT_SYMBOL_NS_GPL (adxl313_core_probe,IIO_ADXL313 );MODULE_AUTHOR ("Lucas Stankus <[email protected]>" );MODULE_DESCRIPTION ("ADXL313 3-Axis Digital Accelerometer core driver" );
drivers/iio/accel/adxl313_i2c.c +1 -0
@@ -64,3 +64,4 @@ module_i2c_driver(adxl313_i2c_driver);MODULE_AUTHOR ("Lucas Stankus <[email protected]>" );MODULE_DESCRIPTION ("ADXL313 3-Axis Digital Accelerometer I2C driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL313 );
drivers/iio/accel/adxl313_spi.c +1 -0
@@ -90,3 +90,4 @@ module_spi_driver(adxl313_spi_driver);MODULE_AUTHOR ("Lucas Stankus <[email protected]>" );MODULE_DESCRIPTION ("ADXL313 3-Axis Digital Accelerometer SPI driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL313 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 6/13 iio:accel:adxl345: Move exports into IIO_ADXL345 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
--- drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/iio/accel/adxl345_core.c +1 -1
@@ -270,7 +270,7 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap,return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (adxl345_core_probe); +EXPORT_SYMBOL_NS_GPL (adxl345_core_probe,IIO_ADXL345 );MODULE_AUTHOR ("Eva Rachel Retuya <[email protected]>" );MODULE_DESCRIPTION ("ADXL345 3-Axis Digital Accelerometer core driver" );
drivers/iio/accel/adxl345_i2c.c +1 -0
@@ -68,3 +68,4 @@ module_i2c_driver(adxl345_i2c_driver);MODULE_AUTHOR ("Eva Rachel Retuya <[email protected]>" );MODULE_DESCRIPTION ("ADXL345 3-Axis Digital Accelerometer I2C driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL345 );
drivers/iio/accel/adxl345_spi.c +1 -0
@@ -72,3 +72,4 @@ module_spi_driver(adxl345_spi_driver);MODULE_AUTHOR ("Eva Rachel Retuya <[email protected]>" );MODULE_DESCRIPTION ("ADXL345 3-Axis Digital Accelerometer SPI driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL345 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 7/13 iio:accel:adxl355: Move exports into IIO_ADXL355 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/adxl355_core.c | 6 +++--- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/adxl355_core.c +3 -3
@@ -72,7 +72,7 @@ const struct regmap_access_table adxl355_readable_regs_tbl = { .yes_ranges = adxl355_read_reg_range, .n_yes_ranges = ARRAY_SIZE(adxl355_read_reg_range), }; -EXPORT_SYMBOL_GPL (adxl355_readable_regs_tbl); +EXPORT_SYMBOL_NS_GPL (adxl355_readable_regs_tbl,IIO_ADXL355 );static const struct regmap_range adxl355_write_reg_range[] = {regmap_reg_range (ADXL355_OFFSET_X_H_REG ,ADXL355_RESET_REG ),
@@ -82,7 +82,7 @@ const struct regmap_access_table adxl355_writeable_regs_tbl = { .yes_ranges = adxl355_write_reg_range, .n_yes_ranges = ARRAY_SIZE(adxl355_write_reg_range), }; -EXPORT_SYMBOL_GPL (adxl355_writeable_regs_tbl); +EXPORT_SYMBOL_NS_GPL (adxl355_writeable_regs_tbl,IIO_ADXL355 );enum adxl355_op_mode {ADXL355_MEASUREMENT ,
@@ -758,7 +758,7 @@ int adxl355_core_probe(struct device *dev, struct regmap *regmap,return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (adxl355_core_probe); +EXPORT_SYMBOL_NS_GPL (adxl355_core_probe,IIO_ADXL355 );MODULE_AUTHOR ("Puranjay Mohan <[email protected]>" );MODULE_DESCRIPTION ("ADXL355 3-Axis Digital Accelerometer core driver" );
drivers/iio/accel/adxl355_i2c.c +1 -0
@@ -60,3 +60,4 @@ module_i2c_driver(adxl355_i2c_driver);MODULE_AUTHOR ("Puranjay Mohan <[email protected]>" );MODULE_DESCRIPTION ("ADXL355 3-Axis Digital Accelerometer I2C driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL355 );
drivers/iio/accel/adxl355_spi.c +1 -0
@@ -63,3 +63,4 @@ module_spi_driver(adxl355_spi_driver);MODULE_AUTHOR ("Puranjay Mohan <[email protected]>" );MODULE_DESCRIPTION ("ADXL355 3-Axis Digital Accelerometer SPI driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ADXL355 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 8/13 iio:accel:adxl372: Move exports into IIO_ADXL372 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/adxl372.c | 4 ++-- drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/iio/accel/adxl372.c +2 -2
@@ -1176,7 +1176,7 @@ bool adxl372_readable_noinc_reg(struct device *dev, unsigned int reg) {return (reg ==ADXL372_FIFO_DATA ); } -EXPORT_SYMBOL_GPL (adxl372_readable_noinc_reg); +EXPORT_SYMBOL_NS_GPL (adxl372_readable_noinc_reg,IIO_ADXL372 );int adxl372_probe (struct device *dev,struct regmap *regmap,int irq,const char *name)
@@ -1260,7 +1260,7 @@ int adxl372_probe(struct device *dev, struct regmap *regmap,return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (adxl372_probe); +EXPORT_SYMBOL_NS_GPL (adxl372_probe,IIO_ADXL372 );MODULE_AUTHOR ("Stefan Popa <[email protected]>" );MODULE_DESCRIPTION ("Analog Devices ADXL372 3-axis accelerometer driver" );
drivers/iio/accel/adxl372_i2c.c +1 -0
@@ -67,3 +67,4 @@ module_i2c_driver(adxl372_i2c_driver);MODULE_AUTHOR ("Stefan Popa <[email protected]>" );MODULE_DESCRIPTION ("Analog Devices ADXL372 3-axis accelerometer I2C driver" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IIO_ADXL372 );
drivers/iio/accel/adxl372_spi.c +1 -0
@@ -59,3 +59,4 @@ module_spi_driver(adxl372_spi_driver);MODULE_AUTHOR ("Stefan Popa <[email protected]>" );MODULE_DESCRIPTION ("Analog Devices ADXL372 3-axis accelerometer SPI driver" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IIO_ADXL372 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 9/13 iio:accel:bmc150: Move exports into IIO_BMC150 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/bmc150-accel-core.c | 8 ++++---- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +4 -4
@@ -203,7 +203,7 @@ const struct regmap_config bmc150_regmap_conf = { .val_bits = 8, .max_register = 0x3f, }; -EXPORT_SYMBOL_GPL (bmc150_regmap_conf); +EXPORT_SYMBOL_NS_GPL (bmc150_regmap_conf,IIO_BMC150 ); static int bmc150_accel_set_mode(struct bmc150_accel_data *data, enum bmc150_power_modes mode,
@@ -1798,7 +1798,7 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,return ret; } -EXPORT_SYMBOL_GPL (bmc150_accel_core_probe); +EXPORT_SYMBOL_NS_GPL (bmc150_accel_core_probe,IIO_BMC150 );void bmc150_accel_core_remove (struct device *dev) {
@@ -1821,7 +1821,7 @@ void bmc150_accel_core_remove(struct device *dev)regulator_bulk_disable (ARRAY_SIZE (data->regulators), data->regulators); } -EXPORT_SYMBOL_GPL (bmc150_accel_core_remove); +EXPORT_SYMBOL_NS_GPL (bmc150_accel_core_remove,IIO_BMC150 );#ifdef CONFIG_PM_SLEEP static int bmc150_accel_suspend (struct device *dev)
@@ -1896,7 +1896,7 @@ const struct dev_pm_ops bmc150_accel_pm_ops = {SET_RUNTIME_PM_OPS (bmc150_accel_runtime_suspend, bmc150_accel_runtime_resume, NULL) }; -EXPORT_SYMBOL_GPL (bmc150_accel_pm_ops); +EXPORT_SYMBOL_NS_GPL (bmc150_accel_pm_ops,IIO_BMC150 );MODULE_AUTHOR ("Srinivas Pandruvada <[email protected]>" );MODULE_LICENSE ("GPL v2" );
drivers/iio/accel/bmc150-accel-i2c.c +1 -0
@@ -280,3 +280,4 @@ module_i2c_driver(bmc150_accel_driver);MODULE_AUTHOR ("Srinivas Pandruvada <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("BMC150 I2C accelerometer driver" ); +MODULE_IMPORT_NS (IIO_BMC150 );
drivers/iio/accel/bmc150-accel-spi.c +1 -0
@@ -84,3 +84,4 @@ module_spi_driver(bmc150_accel_driver);MODULE_AUTHOR ("Markus Pargmann <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("BMC150 SPI accelerometer driver" ); +MODULE_IMPORT_NS (IIO_BMC150 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 10/13 iio:accel:bmi088: Move exports into IIO_BMI088 namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/bmi088-accel-core.c | 8 ++++---- drivers/iio/accel/bmi088-accel-spi.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/iio/accel/bmi088-accel-core.c +4 -4
@@ -146,7 +146,7 @@ const struct regmap_config bmi088_regmap_conf = { .volatile_table = &bmi088_volatile_table, .cache_type = REGCACHE_RBTREE, }; -EXPORT_SYMBOL_GPL (bmi088_regmap_conf); +EXPORT_SYMBOL_NS_GPL (bmi088_regmap_conf,IIO_BMI088 );static int bmi088_accel_power_up (struct bmi088_accel_data *data) {
@@ -533,7 +533,7 @@ int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap,return ret; } -EXPORT_SYMBOL_GPL (bmi088_accel_core_probe); +EXPORT_SYMBOL_NS_GPL (bmi088_accel_core_probe,IIO_BMI088 );void bmi088_accel_core_remove (struct device *dev)
@@ -547,7 +547,7 @@ void bmi088_accel_core_remove(struct device *dev)pm_runtime_set_suspended (dev);bmi088_accel_power_down (data); } -EXPORT_SYMBOL_GPL (bmi088_accel_core_remove); +EXPORT_SYMBOL_NS_GPL (bmi088_accel_core_remove,IIO_BMI088 );static int __maybe_unused bmi088_accel_runtime_suspend (struct device *dev) {
@@ -571,7 +571,7 @@ const struct dev_pm_ops bmi088_accel_pm_ops = {SET_RUNTIME_PM_OPS (bmi088_accel_runtime_suspend, bmi088_accel_runtime_resume, NULL) }; -EXPORT_SYMBOL_GPL (bmi088_accel_pm_ops); +EXPORT_SYMBOL_NS_GPL (bmi088_accel_pm_ops,IIO_BMI088 );MODULE_AUTHOR ("Niek van Agt <[email protected]>" );MODULE_LICENSE ("GPL v2" );
drivers/iio/accel/bmi088-accel-spi.c +1 -0
@@ -83,3 +83,4 @@ module_spi_driver(bmi088_accel_driver);MODULE_AUTHOR ("Niek van Agt <[email protected]>" );MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("BMI088 accelerometer driver (SPI)" ); +MODULE_IMPORT_NS (IIO_BMI088 );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 11/13 iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/fxls8962af-core.c | 6 +++--- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/iio/accel/fxls8962af-core.c +3 -3
@@ -178,7 +178,7 @@ const struct regmap_config fxls8962af_regmap_conf = { .val_bits = 8, .max_register = FXLS8962AF_MAX_REG, }; -EXPORT_SYMBOL_GPL (fxls8962af_regmap_conf); +EXPORT_SYMBOL_NS_GPL (fxls8962af_regmap_conf,IIO_FXLS8962AF );enum { fxls8962af_idx_x,
@@ -1232,7 +1232,7 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq)return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (fxls8962af_core_probe); +EXPORT_SYMBOL_NS_GPL (fxls8962af_core_probe,IIO_FXLS8962AF );static int __maybe_unused fxls8962af_runtime_suspend (struct device *dev) {
@@ -1298,7 +1298,7 @@ const struct dev_pm_ops fxls8962af_pm_ops = {SET_RUNTIME_PM_OPS (fxls8962af_runtime_suspend, fxls8962af_runtime_resume, NULL) }; -EXPORT_SYMBOL_GPL (fxls8962af_pm_ops); +EXPORT_SYMBOL_NS_GPL (fxls8962af_pm_ops,IIO_FXLS8962AF );MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer driver" );
drivers/iio/accel/fxls8962af-i2c.c +1 -0
@@ -55,3 +55,4 @@ module_i2c_driver(fxls8962af_driver);MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_FXLS8962AF );
drivers/iio/accel/fxls8962af-spi.c +1 -0
@@ -55,3 +55,4 @@ module_spi_driver(fxls8962af_driver);MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_FXLS8962AF );
Signature · 1 line
2.34.1
Re: [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace
Quoted 10 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core exports into their own namespace and import that into the two bus modules.
For more info see https://lwn.net/Articles/760045/
Signed-off-by Jonathan Cameron <[email protected]>Cc Sean Nyekjaer <[email protected]>
Looks good :)
Quoted 58 lines
--- drivers/iio/accel/fxls8962af-core.c | 6 +++--- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)drivers/iio/accel/fxls8962af-core.c +3
-3@@ -178,7 +178,7 @@ const struct regmap_config fxls8962af_regmap_conf = { .val_bits = 8, .max_register = FXLS8962AF_MAX_REG, }; -EXPORT_SYMBOL_GPL (fxls8962af_regmap_conf); +EXPORT_SYMBOL_NS_GPL (fxls8962af_regmap_conf,IIO_FXLS8962AF );enum { fxls8962af_idx_x,@@ -1232,7 +1232,7 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq)return devm_iio_device_register (dev, indio_dev); } -EXPORT_SYMBOL_GPL (fxls8962af_core_probe); +EXPORT_SYMBOL_NS_GPL (fxls8962af_core_probe,IIO_FXLS8962AF );static int __maybe_unused fxls8962af_runtime_suspend (struct device *dev) {@@ -1298,7 +1298,7 @@ const struct dev_pm_ops fxls8962af_pm_ops = {SET_RUNTIME_PM_OPS (fxls8962af_runtime_suspend, fxls8962af_runtime_resume, NULL) }; -EXPORT_SYMBOL_GPL (fxls8962af_pm_ops); +EXPORT_SYMBOL_NS_GPL (fxls8962af_pm_ops,IIO_FXLS8962AF );MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer driver" );drivers/iio/accel/fxls8962af-i2c.c +1
-0@@ -55,3 +55,4 @@ module_i2c_driver(fxls8962af_driver);MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_FXLS8962AF );drivers/iio/accel/fxls8962af-spi.c +1
-0@@ -55,3 +55,4 @@ module_spi_driver(fxls8962af_driver);MODULE_AUTHOR ("Sean Nyekjaer <[email protected]>" );MODULE_DESCRIPTION ("NXP FXLS8962AF/FXLS8964AF accelerometer spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_FXLS8962AF );Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 12/13 iio:st-sensors: Remove duplicate MODULE_*
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
The core module and type specific core modules are made up of several files. There is no benefit in duplicating the MODULE_* macros in each file so remove them.
Noticed whilst adding MODULE_IMPORT_NS() as I missed some files and it still worked, making it clear not all of these blocks were needed.
--- drivers/iio/accel/st_accel_buffer.c | 5 ----- drivers/iio/common/st_sensors/st_sensors_buffer.c | 5 ----- drivers/iio/common/st_sensors/st_sensors_trigger.c | 5 ----- drivers/iio/gyro/st_gyro_buffer.c | 4 ---- drivers/iio/magnetometer/st_magn_buffer.c | 4 ---- drivers/iio/pressure/st_pressure_buffer.c | 5 ----- 6 files changed, 28 deletions(-)
drivers/iio/accel/st_accel_buffer.c +0 -5
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h>
@@ -65,7 +64,3 @@ int st_accel_allocate_ring(struct iio_dev *indio_dev)return devm_iio_triggered_buffer_setup (indio_dev->dev.parent, indio_dev,NULL , &st_sensors_trigger_handler, &st_accel_buffer_setup_ops); } - -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics accelerometers buffer" ); -MODULE_LICENSE ("GPL v2" );
drivers/iio/common/st_sensors/st_sensors_buffer.c +0 -5
@@ -8,7 +8,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/iio/iio.h> #include <linux/iio/trigger.h> #include <linux/interrupt.h>
@@ -78,7 +77,3 @@ irqreturn_t st_sensors_trigger_handler(int irq, void *p)return IRQ_HANDLED ; }EXPORT_SYMBOL (st_sensors_trigger_handler); - -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics ST-sensors buffer" ); -MODULE_LICENSE ("GPL v2" );
drivers/iio/common/st_sensors/st_sensors_trigger.c +0 -5
@@ -8,7 +8,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/iio/iio.h> #include <linux/iio/trigger.h> #include <linux/interrupt.h>
@@ -241,7 +240,3 @@ int st_sensors_validate_device(struct iio_trigger *trig,return 0 ; }EXPORT_SYMBOL (st_sensors_validate_device); - -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics ST-sensors trigger" ); -MODULE_LICENSE ("GPL v2" );
drivers/iio/gyro/st_gyro_buffer.c +0 -4
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h>
@@ -65,6 +64,3 @@ int st_gyro_allocate_ring(struct iio_dev *indio_dev) NULL, &st_sensors_trigger_handler, &st_gyro_buffer_setup_ops); } -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics gyroscopes buffer" ); -MODULE_LICENSE ("GPL v2" );
drivers/iio/magnetometer/st_magn_buffer.c +0 -4
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h>
@@ -45,6 +44,3 @@ int st_magn_allocate_ring(struct iio_dev *indio_dev) NULL, &st_sensors_trigger_handler, &st_magn_buffer_setup_ops); } -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics magnetometers buffer" ); -MODULE_LICENSE ("GPL v2" );
drivers/iio/pressure/st_pressure_buffer.c +0 -5
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h>
@@ -44,7 +43,3 @@ int st_press_allocate_ring(struct iio_dev *indio_dev)return devm_iio_triggered_buffer_setup (indio_dev->dev.parent, indio_dev,NULL , &st_sensors_trigger_handler, &st_press_buffer_setup_ops); } - -MODULE_AUTHOR ("Denis Ciocca <[email protected]>" ); -MODULE_DESCRIPTION ("STMicroelectronics pressures buffer" ); -MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerPATCH v2 13/13 iio:st-sensors: Move exports into IIO_ST_SENSORS namespace
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
To avoid unnecessary pollution of the global symbol namespace move the driver core and type specific core exports into their a new namespace and import that where needed.
For more info see https://lwn.net/Articles/760045/
--- drivers/iio/accel/st_accel_core.c | 5 ++-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 + .../iio/common/st_sensors/st_sensors_buffer.c | 2 +- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++++---------- .../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 4 +-- drivers/iio/gyro/st_gyro_core.c | 5 ++-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_core.c | 5 ++-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_core.c | 5 ++-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 + 20 files changed, 43 insertions(+), 28 deletions(-)
drivers/iio/accel/st_accel_core.c +3 -2
@@ -1329,7 +1329,7 @@ const struct st_sensor_settings *st_accel_get_settings(const char *name)return &st_accel_sensors_settings[index]; } -EXPORT_SYMBOL (st_accel_get_settings); +EXPORT_SYMBOL_NS (st_accel_get_settings,IIO_ST_SENSORS );int st_accel_common_probe (struct iio_dev *indio_dev) {
@@ -1383,8 +1383,9 @@ int st_accel_common_probe(struct iio_dev *indio_dev)return devm_iio_device_register (parent, indio_dev); } -EXPORT_SYMBOL (st_accel_common_probe); +EXPORT_SYMBOL_NS (st_accel_common_probe,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics accelerometers driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/accel/st_accel_i2c.c +1 -0
@@ -194,3 +194,4 @@ module_i2c_driver(st_accel_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics accelerometers i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/accel/st_accel_spi.c +1 -0
@@ -164,3 +164,4 @@ module_spi_driver(st_accel_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics accelerometers spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/common/st_sensors/st_sensors_buffer.c +1 -1
@@ -76,4 +76,4 @@ irqreturn_t st_sensors_trigger_handler(int irq, void *p)return IRQ_HANDLED ; } -EXPORT_SYMBOL (st_sensors_trigger_handler); +EXPORT_SYMBOL_NS (st_sensors_trigger_handler,IIO_ST_SENSORS );
drivers/iio/common/st_sensors/st_sensors_core.c +14 -14
@@ -46,7 +46,7 @@ int st_sensors_debugfs_reg_access(struct iio_dev *indio_dev,return 0 ; } -EXPORT_SYMBOL (st_sensors_debugfs_reg_access); +EXPORT_SYMBOL_NS (st_sensors_debugfs_reg_access,IIO_ST_SENSORS );static int st_sensors_match_odr (struct st_sensor_settings *sensor_settings,unsigned int odr,struct st_sensor_odr_avl *odr_out)
@@ -106,7 +106,7 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr) st_sensors_match_odr_error:return err; } -EXPORT_SYMBOL (st_sensors_set_odr); +EXPORT_SYMBOL_NS (st_sensors_set_odr,IIO_ST_SENSORS );static int st_sensors_match_fs (struct st_sensor_settings *sensor_settings,unsigned int fs,int *index_fs_avl)
@@ -199,7 +199,7 @@ int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable) set_enable_error:return err; } -EXPORT_SYMBOL (st_sensors_set_enable); +EXPORT_SYMBOL_NS (st_sensors_set_enable,IIO_ST_SENSORS );int st_sensors_set_axis_enable (struct iio_dev *indio_dev,u8 axis_enable) {
@@ -213,7 +213,7 @@ int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable) axis_enable);return err; } -EXPORT_SYMBOL (st_sensors_set_axis_enable); +EXPORT_SYMBOL_NS (st_sensors_set_axis_enable,IIO_ST_SENSORS );static void st_reg_disable (void *reg) {
@@ -257,7 +257,7 @@ int st_sensors_power_enable(struct iio_dev *indio_dev)return devm_add_action_or_reset (parent, st_reg_disable, pdata->vdd_io); } -EXPORT_SYMBOL (st_sensors_power_enable); +EXPORT_SYMBOL_NS (st_sensors_power_enable,IIO_ST_SENSORS );static int st_sensors_set_drdy_int_pin (struct iio_dev *indio_dev,struct st_sensors_platform_data *pdata)
@@ -352,7 +352,7 @@ void st_sensors_dev_name_probe(struct device *dev, char *name, int len)/* The name from the match takes precedence if present */ strlcpy (name, match, len); } -EXPORT_SYMBOL (st_sensors_dev_name_probe); +EXPORT_SYMBOL_NS (st_sensors_dev_name_probe,IIO_ST_SENSORS );int st_sensors_init_sensor (struct iio_dev *indio_dev,struct st_sensors_platform_data *pdata)
@@ -437,7 +437,7 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,return err; } -EXPORT_SYMBOL (st_sensors_init_sensor); +EXPORT_SYMBOL_NS (st_sensors_init_sensor,IIO_ST_SENSORS );int st_sensors_set_dataready_irq (struct iio_dev *indio_dev,bool enable) {
@@ -486,7 +486,7 @@ int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable) st_accel_set_dataready_irq_error:return err; } -EXPORT_SYMBOL (st_sensors_set_dataready_irq); +EXPORT_SYMBOL_NS (st_sensors_set_dataready_irq,IIO_ST_SENSORS );int st_sensors_set_fullscale_by_gain (struct iio_dev *indio_dev,int scale) {
@@ -509,7 +509,7 @@ int st_sensors_set_fullscale_by_gain(struct iio_dev *indio_dev, int scale) st_sensors_match_scale_error:return err; } -EXPORT_SYMBOL (st_sensors_set_fullscale_by_gain); +EXPORT_SYMBOL_NS (st_sensors_set_fullscale_by_gain,IIO_ST_SENSORS );static int st_sensors_read_axis_data (struct iio_dev *indio_dev,struct iio_chan_spec const *ch,int *data)
@@ -572,7 +572,7 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,return err; } -EXPORT_SYMBOL (st_sensors_read_info_raw); +EXPORT_SYMBOL_NS (st_sensors_read_info_raw,IIO_ST_SENSORS );/* * st_sensors_get_settings_index() - get index of the sensor settings for a
@@ -599,7 +599,7 @@ int st_sensors_get_settings_index(const char *name,return -ENODEV ; } -EXPORT_SYMBOL (st_sensors_get_settings_index); +EXPORT_SYMBOL_NS (st_sensors_get_settings_index,IIO_ST_SENSORS );/* * st_sensors_verify_id() - verify sensor ID (WhoAmI) is matching with the
@@ -632,7 +632,7 @@ int st_sensors_verify_id(struct iio_dev *indio_dev)return 0 ; } -EXPORT_SYMBOL (st_sensors_verify_id); +EXPORT_SYMBOL_NS (st_sensors_verify_id,IIO_ST_SENSORS );ssize_t st_sensors_sysfs_sampling_frequency_avail (struct device *dev,struct device_attribute *attr,char *buf)
@@ -654,7 +654,7 @@ ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev,return len; } -EXPORT_SYMBOL (st_sensors_sysfs_sampling_frequency_avail); +EXPORT_SYMBOL_NS (st_sensors_sysfs_sampling_frequency_avail,IIO_ST_SENSORS );ssize_t st_sensors_sysfs_scale_avail (struct device *dev,struct device_attribute *attr,char *buf)
@@ -678,7 +678,7 @@ ssize_t st_sensors_sysfs_scale_avail(struct device *dev,return len; } -EXPORT_SYMBOL (st_sensors_sysfs_scale_avail); +EXPORT_SYMBOL_NS (st_sensors_sysfs_scale_avail,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics ST-sensors core" );
drivers/iio/common/st_sensors/st_sensors_i2c.c +1 -1
@@ -61,7 +61,7 @@ int st_sensors_i2c_configure(struct iio_dev *indio_dev,return 0 ; } -EXPORT_SYMBOL (st_sensors_i2c_configure); +EXPORT_SYMBOL_NS (st_sensors_i2c_configure,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics ST-sensors i2c driver" );
drivers/iio/common/st_sensors/st_sensors_spi.c +1 -1
@@ -113,7 +113,7 @@ int st_sensors_spi_configure(struct iio_dev *indio_dev,return 0 ; } -EXPORT_SYMBOL (st_sensors_spi_configure); +EXPORT_SYMBOL_NS (st_sensors_spi_configure,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics ST-sensors spi driver" );
drivers/iio/common/st_sensors/st_sensors_trigger.c +2 -2
@@ -227,7 +227,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev,return 0 ; } -EXPORT_SYMBOL (st_sensors_allocate_trigger); +EXPORT_SYMBOL_NS (st_sensors_allocate_trigger,IIO_ST_SENSORS );int st_sensors_validate_device (struct iio_trigger *trig,struct iio_dev *indio_dev)
@@ -239,4 +239,4 @@ int st_sensors_validate_device(struct iio_trigger *trig,return 0 ; } -EXPORT_SYMBOL (st_sensors_validate_device); +EXPORT_SYMBOL_NS (st_sensors_validate_device,IIO_ST_SENSORS );
drivers/iio/gyro/st_gyro_core.c +3 -2
@@ -472,7 +472,7 @@ const struct st_sensor_settings *st_gyro_get_settings(const char *name)return &st_gyro_sensors_settings[index]; } -EXPORT_SYMBOL (st_gyro_get_settings); +EXPORT_SYMBOL_NS (st_gyro_get_settings,IIO_ST_SENSORS );int st_gyro_common_probe (struct iio_dev *indio_dev) {
@@ -518,8 +518,9 @@ int st_gyro_common_probe(struct iio_dev *indio_dev)return devm_iio_device_register (parent, indio_dev); } -EXPORT_SYMBOL (st_gyro_common_probe); +EXPORT_SYMBOL_NS (st_gyro_common_probe,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics gyroscopes driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/gyro/st_gyro_i2c.c +1 -0
@@ -120,3 +120,4 @@ module_i2c_driver(st_gyro_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics gyroscopes i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/gyro/st_gyro_spi.c +1 -0
@@ -124,3 +124,4 @@ module_spi_driver(st_gyro_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics gyroscopes spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c +2 -1
@@ -142,8 +142,9 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap)/* Setup magnetometer device */ return st_lsm9ds0_probe_magn (lsm9ds0, regmap); } -EXPORT_SYMBOL_GPL (st_lsm9ds0_probe); +EXPORT_SYMBOL_NS_GPL (st_lsm9ds0_probe,IIO_ST_SENSORS );MODULE_AUTHOR ("Andy Shevchenko <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics LSM9DS0 IMU core driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +1 -0
@@ -77,3 +77,4 @@ module_i2c_driver(st_lsm9ds0_driver);MODULE_AUTHOR ("Andy Shevchenko <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics LSM9DS0 IMU I2C driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c +1 -0
@@ -76,3 +76,4 @@ module_spi_driver(st_lsm9ds0_driver);MODULE_AUTHOR ("Andy Shevchenko <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics LSM9DS0 IMU SPI driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/magnetometer/st_magn_core.c +3 -2
@@ -606,7 +606,7 @@ const struct st_sensor_settings *st_magn_get_settings(const char *name)return &st_magn_sensors_settings[index]; } -EXPORT_SYMBOL (st_magn_get_settings); +EXPORT_SYMBOL_NS (st_magn_get_settings,IIO_ST_SENSORS );int st_magn_common_probe (struct iio_dev *indio_dev) {
@@ -653,8 +653,9 @@ int st_magn_common_probe(struct iio_dev *indio_dev)return devm_iio_device_register (parent, indio_dev); } -EXPORT_SYMBOL (st_magn_common_probe); +EXPORT_SYMBOL_NS (st_magn_common_probe,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics magnetometers driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/magnetometer/st_magn_i2c.c +1 -0
@@ -115,3 +115,4 @@ module_i2c_driver(st_magn_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics magnetometers i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/magnetometer/st_magn_spi.c +1 -0
@@ -106,3 +106,4 @@ module_spi_driver(st_magn_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics magnetometers spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/pressure/st_pressure_core.c +3 -2
@@ -672,7 +672,7 @@ const struct st_sensor_settings *st_press_get_settings(const char *name)return &st_press_sensors_settings[index]; } -EXPORT_SYMBOL (st_press_get_settings); +EXPORT_SYMBOL_NS (st_press_get_settings,IIO_ST_SENSORS );int st_press_common_probe (struct iio_dev *indio_dev) {
@@ -724,8 +724,9 @@ int st_press_common_probe(struct iio_dev *indio_dev)return devm_iio_device_register (parent, indio_dev); } -EXPORT_SYMBOL (st_press_common_probe); +EXPORT_SYMBOL_NS (st_press_common_probe,IIO_ST_SENSORS );MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics pressures driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/pressure/st_pressure_i2c.c +1 -0
@@ -120,3 +120,4 @@ module_i2c_driver(st_press_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics pressures i2c driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
drivers/iio/pressure/st_pressure_spi.c +1 -0
@@ -118,3 +118,4 @@ module_spi_driver(st_press_driver);MODULE_AUTHOR ("Denis Ciocca <[email protected]>" );MODULE_DESCRIPTION ("STMicroelectronics pressures spi driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (IIO_ST_SENSORS );
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerQuoted 1 line · On Sun, 16 Jan 2022 18:05:22 +0000 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Hi All,
I'd appreciate it if someone has a chance to look at this set. Should be fairly simple to review as more or less mechanical changes other than the choice of naming for each namespace.
Thanks,
Jonathan
Quoted 110 lines
Changes since v1:
* AddIIO_prefix to namespaces.https://lwn.net/Articles/760045/ provides a good overview of this feature and why it might be used. In this particular case we fall under the multi module case. For each group of modules, I've moved the exports into an independent namespace.
Whilst I'm not entirely sure it is worth the noise of moving the main IIO exports into a namespace, it is definitely worthwhile for these small clusters of related modules (typically a core + i2c and spi modules).
I've just done those within
drivers/accel(including all of st-sensors as I did not want to do that piecemeal) as an initial set to get feedback on what people think of the approach and in particular naming of the namespaces.As you can see it is a straight forward change to makes so I'll do the rest of the IIO drivers once we are agreed on the generic details. Note that I'll be expecting this for any new cases of this pattern going forwards.
Includes a small diversion in st-sensors where we had a bunch of duplicated MODULE_* macros for some of the core modules which were made up of multiple c files.
Cc Uwe Kleine-König <[email protected]Cc Linus Walleij <[email protected]>Cc Lucas Stankus <[email protected]>Cc Puranjay Mohan <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Mike Looijmans <[email protected]>Cc Sean Nyekjaer <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Linus Walleij <[email protected]>Cc Denis Ciocca <[email protected]>Jonathan Cameron (13):
iio:accel:mma9551_core: Move exports intoIIO_MMA9551namespace iio:accel:mma7455_core: Move exports intoIIO_MMA7455namespace iio:accel:kxsd9: Move exports intoIIO_KDSD9namespace iio:accel:bma400: Move exports intoIIO_BMA400namespace iio:accel:adxl313: Move exports intoIIO_ADXL313namespace iio:accel:adxl345: Move exports intoIIO_ADXL345namespace iio:accel:adxl355: Move exports intoIIO_ADXL355namespace iio:accel:adxl372: Move exports intoIIO_ADXL372namespace iio:accel:bmc150: Move exports intoIIO_BMC150namespace iio:accel:bmi088: Move exports intoIIO_BMI088namespace iio:accel:fxl8962af: Move exports intoIIO_FXL8962AFnamespace iio:st-sensors: Remove duplicate MODULE_* iio:st-sensors: Move exports intoIIO_ST_SENSORSnamespacedrivers/iio/accel/adxl313_core.c | 6 ++-- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + drivers/iio/accel/adxl355_core.c | 6 ++-- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + drivers/iio/accel/adxl372.c | 4 +-- drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + drivers/iio/accel/bma400_core.c | 6 ++-- drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + drivers/iio/accel/bmc150-accel-core.c | 8 ++--- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + drivers/iio/accel/bmi088-accel-core.c | 8 ++--- drivers/iio/accel/bmi088-accel-spi.c | 1 + drivers/iio/accel/fxls8962af-core.c | 6 ++-- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 ++-- drivers/iio/accel/mma7455_core.c | 6 ++-- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 +++++++++---------- drivers/iio/accel/mma9553.c | 1 + drivers/iio/accel/st_accel_buffer.c | 5 --- drivers/iio/accel/st_accel_core.c | 5 +-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 + .../iio/common/st_sensors/st_sensors_buffer.c | 7 +--- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++-------- .../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 9 ++--- drivers/iio/gyro/st_gyro_buffer.c | 4 --- drivers/iio/gyro/st_gyro_core.c | 5 +-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_buffer.c | 4 --- drivers/iio/magnetometer/st_magn_core.c | 5 +-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_buffer.c | 5 --- drivers/iio/pressure/st_pressure_core.c | 5 +-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 + 56 files changed, 111 insertions(+), 103 deletions(-)
Quoted 10 lines · On Sun, 30 Jan 2022 20:01:28 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 1 line · On Sun, 16 Jan 2022 18:05:22 +0000 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Hi All,
I'd appreciate it if someone has a chance to look at this set. Should be fairly simple to review as more or less mechanical changes other than the choice of naming for each namespace.
I plan to pick this set up shortly on basis v1 got some review and comments were all about the prefix. So hopefully everything else is fine.
However, if anyone does have time to sanity check it would be much appreciated as I don't trust myself to not do something silly (call it experience :)
Thanks,
Jonathan
Quoted 116 lines
Thanks,
Jonathan
Quoted 110 lines
Changes since v1:
* AddIIO_prefix to namespaces.https://lwn.net/Articles/760045/ provides a good overview of this feature and why it might be used. In this particular case we fall under the multi module case. For each group of modules, I've moved the exports into an independent namespace.
Whilst I'm not entirely sure it is worth the noise of moving the main IIO exports into a namespace, it is definitely worthwhile for these small clusters of related modules (typically a core + i2c and spi modules).
I've just done those within
drivers/accel(including all of st-sensors as I did not want to do that piecemeal) as an initial set to get feedback on what people think of the approach and in particular naming of the namespaces.As you can see it is a straight forward change to makes so I'll do the rest of the IIO drivers once we are agreed on the generic details. Note that I'll be expecting this for any new cases of this pattern going forwards.
Includes a small diversion in st-sensors where we had a bunch of duplicated MODULE_* macros for some of the core modules which were made up of multiple c files.
Cc Uwe Kleine-König <[email protected]Cc Linus Walleij <[email protected]>Cc Lucas Stankus <[email protected]>Cc Puranjay Mohan <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Mike Looijmans <[email protected]>Cc Sean Nyekjaer <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Linus Walleij <[email protected]>Cc Denis Ciocca <[email protected]>Jonathan Cameron (13):
iio:accel:mma9551_core: Move exports intoIIO_MMA9551namespace iio:accel:mma7455_core: Move exports intoIIO_MMA7455namespace iio:accel:kxsd9: Move exports intoIIO_KDSD9namespace iio:accel:bma400: Move exports intoIIO_BMA400namespace iio:accel:adxl313: Move exports intoIIO_ADXL313namespace iio:accel:adxl345: Move exports intoIIO_ADXL345namespace iio:accel:adxl355: Move exports intoIIO_ADXL355namespace iio:accel:adxl372: Move exports intoIIO_ADXL372namespace iio:accel:bmc150: Move exports intoIIO_BMC150namespace iio:accel:bmi088: Move exports intoIIO_BMI088namespace iio:accel:fxl8962af: Move exports intoIIO_FXL8962AFnamespace iio:st-sensors: Remove duplicate MODULE_* iio:st-sensors: Move exports intoIIO_ST_SENSORSnamespacedrivers/iio/accel/adxl313_core.c | 6 ++-- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + drivers/iio/accel/adxl355_core.c | 6 ++-- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + drivers/iio/accel/adxl372.c | 4 +-- drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + drivers/iio/accel/bma400_core.c | 6 ++-- drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + drivers/iio/accel/bmc150-accel-core.c | 8 ++--- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + drivers/iio/accel/bmi088-accel-core.c | 8 ++--- drivers/iio/accel/bmi088-accel-spi.c | 1 + drivers/iio/accel/fxls8962af-core.c | 6 ++-- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 ++-- drivers/iio/accel/mma7455_core.c | 6 ++-- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 +++++++++---------- drivers/iio/accel/mma9553.c | 1 + drivers/iio/accel/st_accel_buffer.c | 5 --- drivers/iio/accel/st_accel_core.c | 5 +-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 + .../iio/common/st_sensors/st_sensors_buffer.c | 7 +--- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++-------- .../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 9 ++--- drivers/iio/gyro/st_gyro_buffer.c | 4 --- drivers/iio/gyro/st_gyro_core.c | 5 +-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_buffer.c | 4 --- drivers/iio/magnetometer/st_magn_core.c | 5 +-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_buffer.c | 5 --- drivers/iio/pressure/st_pressure_core.c | 5 +-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 + 56 files changed, 111 insertions(+), 103 deletions(-)
Quoted 15 lines · Jonathan Cameron
Quoted 11 lines · On Sun, 30 Jan 2022 20:01:28 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 1 line · On Sun, 16 Jan 2022 18:05:22 +0000 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Hi All,
I'd appreciate it if someone has a chance to look at this set. Should be fairly simple to review as more or less mechanical changes
other than the choice of naming for each namespace.
Quoted 7 lines
I plan to pick this set up shortly on basis v1 got some review and comments were all about the prefix. So hopefully everything else is fine.
However, if anyone does have time to sanity check it would be much appreciated as I don't trust myself to not do something silly (call it experience :)
I did sanity check, didn't find any issue.
Thanks,
Srinivas
Quoted 138 lines
Thanks,
Jonathan
Quoted 132 lines
Thanks,
Jonathan
Quoted 126 lines
Changes since v1:
* AddIIO_prefix to namespaces.https://lwn.net/Articles/760045/ provides a good overview of this feature
and why it might be used. In this particular case we fall under the multi
module case. For each group of modules, I've moved the exports into
an independent namespace.Whilst I'm not entirely sure it is worth the noise of moving the main
IIO exports into a namespace, it is definitely worthwhile for these small
clusters of related modules (typically a core + i2c and spi modules).I've just done those within
drivers/accel(including all of st- sensors as
I did not want to do that piecemeal) as an initial set to get feedback on
what people think of the approach and in particular naming of the namespaces.As you can see it is a straight forward change to makes so I'll do the
rest of the IIO drivers once we are agreed on the generic details.
Note that I'll be expecting this for any new cases of this pattern going
forwards.Includes a small diversion in st-sensors where we had a bunch of duplicated
MODULE_* macros for some of the core modules which were made up of multiple
c files.Cc Uwe Kleine-König <[email protected]Cc Linus Walleij <[email protected]>Cc Lucas Stankus <[email protected]>Cc Puranjay Mohan <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Mike Looijmans <[email protected]>Cc Sean Nyekjaer <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Linus Walleij <[email protected]>Cc Denis Ciocca <[email protected]>Jonathan Cameron (13):
iio:accel:mma9551_core: Move exports intoIIO_MMA9551namespace iio:accel:mma7455_core: Move exports intoIIO_MMA7455namespace iio:accel:kxsd9: Move exports intoIIO_KDSD9namespace iio:accel:bma400: Move exports intoIIO_BMA400namespace iio:accel:adxl313: Move exports intoIIO_ADXL313namespace iio:accel:adxl345: Move exports intoIIO_ADXL345namespace iio:accel:adxl355: Move exports intoIIO_ADXL355namespace iio:accel:adxl372: Move exports intoIIO_ADXL372namespace iio:accel:bmc150: Move exports intoIIO_BMC150namespace iio:accel:bmi088: Move exports intoIIO_BMI088namespace iio:accel:fxl8962af: Move exports intoIIO_FXL8962AFnamespace iio:st-sensors: Remove duplicate MODULE_* iio:st-sensors: Move exports intoIIO_ST_SENSORSnamespacedrivers/iio/accel/adxl313_core.c | 6 ++-- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + drivers/iio/accel/adxl355_core.c | 6 ++-- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + drivers/iio/accel/adxl372.c | 4 +--
drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + drivers/iio/accel/bma400_core.c | 6 ++--drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + drivers/iio/accel/bmc150-accel-core.c | 8 ++--- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + drivers/iio/accel/bmi088-accel-core.c | 8 ++--- drivers/iio/accel/bmi088-accel-spi.c | 1 + drivers/iio/accel/fxls8962af-core.c | 6 ++-- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 ++-- drivers/iio/accel/mma7455_core.c | 6 ++-- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 +++++++++----
------
drivers/iio/accel/mma9553.c | 1 + drivers/iio/accel/st_accel_buffer.c | 5 --- drivers/iio/accel/st_accel_core.c | 5 +-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 +.../iio/common/st_sensors/st_sensors_buffer.c| 7 +--- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++------ --.../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 9 ++---drivers/iio/gyro/st_gyro_buffer.c | 4 --- drivers/iio/gyro/st_gyro_core.c | 5 +-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_buffer.c | 4 --- drivers/iio/magnetometer/st_magn_core.c | 5 +-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_buffer.c | 5 --- drivers/iio/pressure/st_pressure_core.c | 5 +-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 +
56 files changed, 111 insertions(+), 103 deletions(-)
Jonathan Cameron
maintainerQuoted 16 lines · On Mon, 14 Feb 2022 07:40:24 -0800 srinivas pandruvada…
Quoted 15 lines · Jonathan Cameron
Quoted 11 lines · On Sun, 30 Jan 2022 20:01:28 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 1 line · On Sun, 16 Jan 2022 18:05:22 +0000 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Hi All,
I'd appreciate it if someone has a chance to look at this set. Should be fairly simple to review as more or less mechanical changes
other than the choice of naming for each namespace.
Quoted 8 lines
Quoted 7 lines
I plan to pick this set up shortly on basis v1 got some review and comments were all about the prefix. So hopefully everything else is fine.
However, if anyone does have time to sanity check it would be much appreciated as I don't trust myself to not do something silly (call it experience :)
I did sanity check, didn't find any issue.
Thanks!
Applied to the togreg branch of iio.git and pushed out as testing see if the autobuilders can find anything we missed.
Jonathan
Quoted 143 lines
Thanks,
SrinivasQuoted 138 lines
Thanks,
Jonathan
Quoted 132 lines
Thanks,
Jonathan
Quoted 126 lines
Changes since v1:
* AddIIO_prefix to namespaces.https://lwn.net/Articles/760045/ provides a good overview of this feature
and why it might be used. In this particular case we fall under the multi
module case. For each group of modules, I've moved the exports into
an independent namespace.Whilst I'm not entirely sure it is worth the noise of moving the main
IIO exports into a namespace, it is definitely worthwhile for these small
clusters of related modules (typically a core + i2c and spi modules).I've just done those within
drivers/accel(including all of st- sensors as
I did not want to do that piecemeal) as an initial set to get feedback on
what people think of the approach and in particular naming of the namespaces.As you can see it is a straight forward change to makes so I'll do the
rest of the IIO drivers once we are agreed on the generic details.
Note that I'll be expecting this for any new cases of this pattern going
forwards.Includes a small diversion in st-sensors where we had a bunch of duplicated
MODULE_* macros for some of the core modules which were made up of multiple
c files.Cc Uwe Kleine-König <[email protected]Cc Linus Walleij <[email protected]>Cc Lucas Stankus <[email protected]>Cc Puranjay Mohan <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Mike Looijmans <[email protected]>Cc Sean Nyekjaer <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Linus Walleij <[email protected]>Cc Denis Ciocca <[email protected]>Jonathan Cameron (13):
iio:accel:mma9551_core: Move exports intoIIO_MMA9551namespace iio:accel:mma7455_core: Move exports intoIIO_MMA7455namespace iio:accel:kxsd9: Move exports intoIIO_KDSD9namespace iio:accel:bma400: Move exports intoIIO_BMA400namespace iio:accel:adxl313: Move exports intoIIO_ADXL313namespace iio:accel:adxl345: Move exports intoIIO_ADXL345namespace iio:accel:adxl355: Move exports intoIIO_ADXL355namespace iio:accel:adxl372: Move exports intoIIO_ADXL372namespace iio:accel:bmc150: Move exports intoIIO_BMC150namespace iio:accel:bmi088: Move exports intoIIO_BMI088namespace iio:accel:fxl8962af: Move exports intoIIO_FXL8962AFnamespace iio:st-sensors: Remove duplicate MODULE_* iio:st-sensors: Move exports intoIIO_ST_SENSORSnamespacedrivers/iio/accel/adxl313_core.c | 6 ++-- drivers/iio/accel/adxl313_i2c.c | 1 + drivers/iio/accel/adxl313_spi.c | 1 + drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl345_i2c.c | 1 + drivers/iio/accel/adxl345_spi.c | 1 + drivers/iio/accel/adxl355_core.c | 6 ++-- drivers/iio/accel/adxl355_i2c.c | 1 + drivers/iio/accel/adxl355_spi.c | 1 + drivers/iio/accel/adxl372.c | 4 +--
drivers/iio/accel/adxl372_i2c.c | 1 + drivers/iio/accel/adxl372_spi.c | 1 + drivers/iio/accel/bma400_core.c | 6 ++--drivers/iio/accel/bma400_i2c.c | 1 + drivers/iio/accel/bma400_spi.c | 1 + drivers/iio/accel/bmc150-accel-core.c | 8 ++--- drivers/iio/accel/bmc150-accel-i2c.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 + drivers/iio/accel/bmi088-accel-core.c | 8 ++--- drivers/iio/accel/bmi088-accel-spi.c | 1 + drivers/iio/accel/fxls8962af-core.c | 6 ++-- drivers/iio/accel/fxls8962af-i2c.c | 1 + drivers/iio/accel/fxls8962af-spi.c | 1 + drivers/iio/accel/kxsd9-i2c.c | 1 + drivers/iio/accel/kxsd9-spi.c | 1 + drivers/iio/accel/kxsd9.c | 6 ++-- drivers/iio/accel/mma7455_core.c | 6 ++-- drivers/iio/accel/mma7455_i2c.c | 1 + drivers/iio/accel/mma7455_spi.c | 1 + drivers/iio/accel/mma9551.c | 1 + drivers/iio/accel/mma9551_core.c | 36 +++++++++----
------
drivers/iio/accel/mma9553.c | 1 + drivers/iio/accel/st_accel_buffer.c | 5 --- drivers/iio/accel/st_accel_core.c | 5 +-- drivers/iio/accel/st_accel_i2c.c | 1 + drivers/iio/accel/st_accel_spi.c | 1 +.../iio/common/st_sensors/st_sensors_buffer.c| 7 +--- .../iio/common/st_sensors/st_sensors_core.c | 28 +++++++------ --.../iio/common/st_sensors/st_sensors_i2c.c | 2 +- .../iio/common/st_sensors/st_sensors_spi.c | 2 +- .../common/st_sensors/st_sensors_trigger.c | 9 ++---drivers/iio/gyro/st_gyro_buffer.c | 4 --- drivers/iio/gyro/st_gyro_core.c | 5 +-- drivers/iio/gyro/st_gyro_i2c.c | 1 + drivers/iio/gyro/st_gyro_spi.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 3 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 1 + drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 1 + drivers/iio/magnetometer/st_magn_buffer.c | 4 --- drivers/iio/magnetometer/st_magn_core.c | 5 +-- drivers/iio/magnetometer/st_magn_i2c.c | 1 + drivers/iio/magnetometer/st_magn_spi.c | 1 + drivers/iio/pressure/st_pressure_buffer.c | 5 --- drivers/iio/pressure/st_pressure_core.c | 5 +-- drivers/iio/pressure/st_pressure_i2c.c | 1 + drivers/iio/pressure/st_pressure_spi.c | 1 +
56 files changed, 111 insertions(+), 103 deletions(-)