All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces
@ 2022-01-16 18:05 Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace Jonathan Cameron
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Linus Walleij, Lucas Stankus, Puranjay Mohan,
	Srinivas Pandruvada, Mike Looijmans, Sean Nyekjaer, Denis Ciocca

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
Cc: Puranjay Mohan <puranjay12@gmail.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Sean Nyekjaer <sean@geanix.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis Ciocca <denis.ciocca@st.com>

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 02/13] iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace Jonathan Cameron
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 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(-)

diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c
index 4c359fb05480..8709c53fa06b 100644
--- a/drivers/iio/accel/mma9551.c
+++ b/drivers/iio/accel/mma9551.c
@@ -622,3 +622,4 @@ MODULE_AUTHOR("Irina Tirdea <irina.tirdea@intel.com>");
 MODULE_AUTHOR("Vlad Dogaru <vlad.dogaru@intel.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("MMA9551L motion-sensing platform driver");
+MODULE_IMPORT_NS(IIO_MMA9551);
diff --git a/drivers/iio/accel/mma9551_core.c b/drivers/iio/accel/mma9551_core.c
index fbf2e2c45678..64ca7d7a9673 100644
--- a/drivers/iio/accel/mma9551_core.c
+++ b/drivers/iio/accel/mma9551_core.c
@@ -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 <irina.tirdea@intel.com>");
 MODULE_AUTHOR("Vlad Dogaru <vlad.dogaru@intel.com>");
diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
index 0570ab1cc064..a836e73c3242 100644
--- a/drivers/iio/accel/mma9553.c
+++ b/drivers/iio/accel/mma9553.c
@@ -1260,3 +1260,4 @@ module_i2c_driver(mma9553_driver);
 MODULE_AUTHOR("Irina Tirdea <irina.tirdea@intel.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("MMA9553L pedometer platform driver");
+MODULE_IMPORT_NS(IIO_MMA9551);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 02/13] iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 03/13] iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace Jonathan Cameron
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Uwe Kleine-König

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 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(-)

diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c
index e6739ba74edf..a34195b3215d 100644
--- a/drivers/iio/accel/mma7455_core.c
+++ b/drivers/iio/accel/mma7455_core.c
@@ -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 <manabian@gmail.com>");
 MODULE_DESCRIPTION("Freescale MMA7455L core accelerometer driver");
diff --git a/drivers/iio/accel/mma7455_i2c.c b/drivers/iio/accel/mma7455_i2c.c
index 8a5256516f9f..a3b84e8a3ea8 100644
--- a/drivers/iio/accel/mma7455_i2c.c
+++ b/drivers/iio/accel/mma7455_i2c.c
@@ -61,3 +61,4 @@ module_i2c_driver(mma7455_i2c_driver);
 MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
 MODULE_DESCRIPTION("Freescale MMA7455L I2C accelerometer driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_MMA7455);
diff --git a/drivers/iio/accel/mma7455_spi.c b/drivers/iio/accel/mma7455_spi.c
index ecf690692dcc..564a0e12cebe 100644
--- a/drivers/iio/accel/mma7455_spi.c
+++ b/drivers/iio/accel/mma7455_spi.c
@@ -49,3 +49,4 @@ module_spi_driver(mma7455_spi_driver);
 MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
 MODULE_DESCRIPTION("Freescale MMA7455L SPI accelerometer driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_MMA7455);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 03/13] iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 02/13] iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 04/13] iio:accel:bma400: Move exports into IIO_BMA400 namespace Jonathan Cameron
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 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(-)

diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c
index 274b41a6e603..c8dc52f11037 100644
--- a/drivers/iio/accel/kxsd9-i2c.c
+++ b/drivers/iio/accel/kxsd9-i2c.c
@@ -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);
diff --git a/drivers/iio/accel/kxsd9-spi.c b/drivers/iio/accel/kxsd9-spi.c
index 441e6b764281..a06a3a273de7 100644
--- a/drivers/iio/accel/kxsd9-spi.c
+++ b/drivers/iio/accel/kxsd9-spi.c
@@ -66,3 +66,4 @@ module_spi_driver(kxsd9_spi_driver);
 MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>");
 MODULE_DESCRIPTION("Kionix KXSD9 SPI driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_KXSD9);
diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c
index 552eba5e8b4f..3975860331a6 100644
--- a/drivers/iio/accel/kxsd9.c
+++ b/drivers/iio/accel/kxsd9.c
@@ -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 <jic23@kernel.org>");
 MODULE_DESCRIPTION("Kionix KXSD9 driver");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 04/13] iio:accel:bma400: Move exports into IIO_BMA400 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (2 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 03/13] iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 05/13] iio:accel:adxl313: Move exports into IIO_ADXL313 namespace Jonathan Cameron
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Linus Walleij

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 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(-)

diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c
index fd2647b728d3..043002fe6f63 100644
--- a/drivers/iio/accel/bma400_core.c
+++ b/drivers/iio/accel/bma400_core.c
@@ -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 <dan@dlrobertson.com>");
 MODULE_DESCRIPTION("Bosch BMA400 triaxial acceleration sensor core");
diff --git a/drivers/iio/accel/bma400_i2c.c b/drivers/iio/accel/bma400_i2c.c
index f50df5310beb..da104ffd3fe0 100644
--- a/drivers/iio/accel/bma400_i2c.c
+++ b/drivers/iio/accel/bma400_i2c.c
@@ -61,3 +61,4 @@ module_i2c_driver(bma400_i2c_driver);
 MODULE_AUTHOR("Dan Robertson <dan@dlrobertson.com>");
 MODULE_DESCRIPTION("Bosch BMA400 triaxial acceleration sensor (I2C)");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_BMA400);
diff --git a/drivers/iio/accel/bma400_spi.c b/drivers/iio/accel/bma400_spi.c
index 9f622e37477b..23f3a8ab30bd 100644
--- a/drivers/iio/accel/bma400_spi.c
+++ b/drivers/iio/accel/bma400_spi.c
@@ -120,3 +120,4 @@ module_spi_driver(bma400_spi_driver);
 MODULE_AUTHOR("Dan Robertson <dan@dlrobertson.com>");
 MODULE_DESCRIPTION("Bosch BMA400 triaxial acceleration sensor (SPI)");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_BMA400);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 05/13] iio:accel:adxl313: Move exports into IIO_ADXL313 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (3 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 04/13] iio:accel:bma400: Move exports into IIO_BMA400 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 06/13] iio:accel:adxl345: Move exports into IIO_ADXL345 namespace Jonathan Cameron
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Lucas Stankus

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
---
 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(-)

diff --git a/drivers/iio/accel/adxl313_core.c b/drivers/iio/accel/adxl313_core.c
index 0d243341f1a7..9e4193e64765 100644
--- a/drivers/iio/accel/adxl313_core.c
+++ b/drivers/iio/accel/adxl313_core.c
@@ -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 <lucas.p.stankus@gmail.com>");
 MODULE_DESCRIPTION("ADXL313 3-Axis Digital Accelerometer core driver");
diff --git a/drivers/iio/accel/adxl313_i2c.c b/drivers/iio/accel/adxl313_i2c.c
index 82e9fb2db1e6..c329765dbf60 100644
--- a/drivers/iio/accel/adxl313_i2c.c
+++ b/drivers/iio/accel/adxl313_i2c.c
@@ -64,3 +64,4 @@ module_i2c_driver(adxl313_i2c_driver);
 MODULE_AUTHOR("Lucas Stankus <lucas.p.stankus@gmail.com>");
 MODULE_DESCRIPTION("ADXL313 3-Axis Digital Accelerometer I2C driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL313);
diff --git a/drivers/iio/accel/adxl313_spi.c b/drivers/iio/accel/adxl313_spi.c
index a6162f36ef52..a3c6d553462d 100644
--- a/drivers/iio/accel/adxl313_spi.c
+++ b/drivers/iio/accel/adxl313_spi.c
@@ -90,3 +90,4 @@ module_spi_driver(adxl313_spi_driver);
 MODULE_AUTHOR("Lucas Stankus <lucas.p.stankus@gmail.com>");
 MODULE_DESCRIPTION("ADXL313 3-Axis Digital Accelerometer SPI driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL313);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 06/13] iio:accel:adxl345: Move exports into IIO_ADXL345 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (4 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 05/13] iio:accel:adxl313: Move exports into IIO_ADXL313 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 07/13] iio:accel:adxl355: Move exports into IIO_ADXL355 namespace Jonathan Cameron
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 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(-)

diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c
index 4b275051ef61..ef2240e356e0 100644
--- a/drivers/iio/accel/adxl345_core.c
+++ b/drivers/iio/accel/adxl345_core.c
@@ -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 <eraretuya@gmail.com>");
 MODULE_DESCRIPTION("ADXL345 3-Axis Digital Accelerometer core driver");
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index a431cba216e6..7bc8324c4f07 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -68,3 +68,4 @@ module_i2c_driver(adxl345_i2c_driver);
 MODULE_AUTHOR("Eva Rachel Retuya <eraretuya@gmail.com>");
 MODULE_DESCRIPTION("ADXL345 3-Axis Digital Accelerometer I2C driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL345);
diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c
index ea559ac2e87d..c752562c5d3b 100644
--- a/drivers/iio/accel/adxl345_spi.c
+++ b/drivers/iio/accel/adxl345_spi.c
@@ -72,3 +72,4 @@ module_spi_driver(adxl345_spi_driver);
 MODULE_AUTHOR("Eva Rachel Retuya <eraretuya@gmail.com>");
 MODULE_DESCRIPTION("ADXL345 3-Axis Digital Accelerometer SPI driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL345);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 07/13] iio:accel:adxl355: Move exports into IIO_ADXL355 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (5 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 06/13] iio:accel:adxl345: Move exports into IIO_ADXL345 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 08/13] iio:accel:adxl372: Move exports into IIO_ADXL372 namespace Jonathan Cameron
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Puranjay Mohan

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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 <Jonathan.Cameron@huawei.com>
Cc: Puranjay Mohan <puranjay12@gmail.com>
---
 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(-)

diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
index 4f485909f459..f207887fafd4 100644
--- a/drivers/iio/accel/adxl355_core.c
+++ b/drivers/iio/accel/adxl355_core.c
@@ -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 <puranjay12@gmail.com>");
 MODULE_DESCRIPTION("ADXL355 3-Axis Digital Accelerometer core driver");
diff --git a/drivers/iio/accel/adxl355_i2c.c b/drivers/iio/accel/adxl355_i2c.c
index 5a987bda9060..f67d57921c81 100644
--- a/drivers/iio/accel/adxl355_i2c.c
+++ b/drivers/iio/accel/adxl355_i2c.c
@@ -60,3 +60,4 @@ module_i2c_driver(adxl355_i2c_driver);
 MODULE_AUTHOR("Puranjay Mohan <puranjay12@gmail.com>");
 MODULE_DESCRIPTION("ADXL355 3-Axis Digital Accelerometer I2C driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL355);
diff --git a/drivers/iio/accel/adxl355_spi.c b/drivers/iio/accel/adxl355_spi.c
index fb225aeb56e3..5fe986ae03f6 100644
--- a/drivers/iio/accel/adxl355_spi.c
+++ b/drivers/iio/accel/adxl355_spi.c
@@ -63,3 +63,4 @@ module_spi_driver(adxl355_spi_driver);
 MODULE_AUTHOR("Puranjay Mohan <puranjay12@gmail.com>");
 MODULE_DESCRIPTION("ADXL355 3-Axis Digital Accelerometer SPI driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ADXL355);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 08/13] iio:accel:adxl372: Move exports into IIO_ADXL372 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (6 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 07/13] iio:accel:adxl355: Move exports into IIO_ADXL355 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 09/13] iio:accel:bmc150: Move exports into IIO_BMC150 namespace Jonathan Cameron
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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 <Jonathan.Cameron@huawei.com>
---
 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(-)

diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c
index 758952584f8c..e3ecbaee61f7 100644
--- a/drivers/iio/accel/adxl372.c
+++ b/drivers/iio/accel/adxl372.c
@@ -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 <stefan.popa@analog.com>");
 MODULE_DESCRIPTION("Analog Devices ADXL372 3-axis accelerometer driver");
diff --git a/drivers/iio/accel/adxl372_i2c.c b/drivers/iio/accel/adxl372_i2c.c
index 9a07ab3d151a..4efb70a5fe40 100644
--- a/drivers/iio/accel/adxl372_i2c.c
+++ b/drivers/iio/accel/adxl372_i2c.c
@@ -67,3 +67,4 @@ module_i2c_driver(adxl372_i2c_driver);
 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
 MODULE_DESCRIPTION("Analog Devices ADXL372 3-axis accelerometer I2C driver");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_ADXL372);
diff --git a/drivers/iio/accel/adxl372_spi.c b/drivers/iio/accel/adxl372_spi.c
index 1f1352fee99a..2bd267a22f29 100644
--- a/drivers/iio/accel/adxl372_spi.c
+++ b/drivers/iio/accel/adxl372_spi.c
@@ -59,3 +59,4 @@ module_spi_driver(adxl372_spi_driver);
 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
 MODULE_DESCRIPTION("Analog Devices ADXL372 3-axis accelerometer SPI driver");
 MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(IIO_ADXL372);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 09/13] iio:accel:bmc150: Move exports into IIO_BMC150 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (7 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 08/13] iio:accel:adxl372: Move exports into IIO_ADXL372 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 10/13] iio:accel:bmi088: Move exports into IIO_BMI088 namespace Jonathan Cameron
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Srinivas Pandruvada

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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/

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 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(-)

diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index e6081dd0a880..a5e0214b7be6 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -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 <srinivas.pandruvada@linux.intel.com>");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index 9e52df9a8f07..dff4d7dd101c 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -280,3 +280,4 @@ module_i2c_driver(bmc150_accel_driver);
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BMC150 I2C accelerometer driver");
+MODULE_IMPORT_NS(IIO_BMC150);
diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c
index 11559567cb39..000632c52800 100644
--- a/drivers/iio/accel/bmc150-accel-spi.c
+++ b/drivers/iio/accel/bmc150-accel-spi.c
@@ -84,3 +84,4 @@ module_spi_driver(bmc150_accel_driver);
 MODULE_AUTHOR("Markus Pargmann <mpa@pengutronix.de>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BMC150 SPI accelerometer driver");
+MODULE_IMPORT_NS(IIO_BMC150);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 10/13] iio:accel:bmi088: Move exports into IIO_BMI088 namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (8 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 09/13] iio:accel:bmc150: Move exports into IIO_BMC150 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace Jonathan Cameron
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Mike Looijmans

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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 <Jonathan.Cameron@huawei.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
---
 drivers/iio/accel/bmi088-accel-core.c | 8 ++++----
 drivers/iio/accel/bmi088-accel-spi.c  | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c
index d74465214feb..8b2728bbcade 100644
--- a/drivers/iio/accel/bmi088-accel-core.c
+++ b/drivers/iio/accel/bmi088-accel-core.c
@@ -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 <niek.van.agt@topicproducts.com>");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c
index 758ad2f12896..961e87a927c4 100644
--- a/drivers/iio/accel/bmi088-accel-spi.c
+++ b/drivers/iio/accel/bmi088-accel-spi.c
@@ -83,3 +83,4 @@ module_spi_driver(bmi088_accel_driver);
 MODULE_AUTHOR("Niek van Agt <niek.van.agt@topicproducts.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BMI088 accelerometer driver (SPI)");
+MODULE_IMPORT_NS(IIO_BMI088);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (9 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 10/13] iio:accel:bmi088: Move exports into IIO_BMI088 namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-31 22:01   ` Sean Nyekjaer
  2022-01-16 18:05 ` [PATCH v2 12/13] iio:st-sensors: Remove duplicate MODULE_* Jonathan Cameron
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Sean Nyekjaer

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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 <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean@geanix.com>
---
 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(-)

diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c
index 32989d91b982..8e763dbf096b 100644
--- a/drivers/iio/accel/fxls8962af-core.c
+++ b/drivers/iio/accel/fxls8962af-core.c
@@ -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 <sean@geanix.com>");
 MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer driver");
diff --git a/drivers/iio/accel/fxls8962af-i2c.c b/drivers/iio/accel/fxls8962af-i2c.c
index cfb004b20455..7e0ecd3bf0d9 100644
--- a/drivers/iio/accel/fxls8962af-i2c.c
+++ b/drivers/iio/accel/fxls8962af-i2c.c
@@ -55,3 +55,4 @@ module_i2c_driver(fxls8962af_driver);
 MODULE_AUTHOR("Sean Nyekjaer <sean@geanix.com>");
 MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_FXLS8962AF);
diff --git a/drivers/iio/accel/fxls8962af-spi.c b/drivers/iio/accel/fxls8962af-spi.c
index 57108d3d480b..0357d54d47cc 100644
--- a/drivers/iio/accel/fxls8962af-spi.c
+++ b/drivers/iio/accel/fxls8962af-spi.c
@@ -55,3 +55,4 @@ module_spi_driver(fxls8962af_driver);
 MODULE_AUTHOR("Sean Nyekjaer <sean@geanix.com>");
 MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_FXLS8962AF);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 12/13] iio:st-sensors: Remove duplicate MODULE_*
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (10 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-16 18:05 ` [PATCH v2 13/13] iio:st-sensors: Move exports into IIO_ST_SENSORS namespace Jonathan Cameron
  2022-01-30 20:01 ` [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Linus Walleij, Denis Ciocca

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 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(-)

diff --git a/drivers/iio/accel/st_accel_buffer.c b/drivers/iio/accel/st_accel_buffer.c
index fc82fa83f1fb..b2977ae19b69 100644
--- a/drivers/iio/accel/st_accel_buffer.c
+++ b/drivers/iio/accel/st_accel_buffer.c
@@ -7,7 +7,6 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
-#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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics accelerometers buffer");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/common/st_sensors/st_sensors_buffer.c b/drivers/iio/common/st_sensors/st_sensors_buffer.c
index dccc471e79da..5f2b1fb95fd7 100644
--- a/drivers/iio/common/st_sensors/st_sensors_buffer.c
+++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c
@@ -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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics ST-sensors buffer");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c
index 392d74449886..ab7a5a24fa6e 100644
--- a/drivers/iio/common/st_sensors/st_sensors_trigger.c
+++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c
@@ -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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics ST-sensors trigger");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/gyro/st_gyro_buffer.c b/drivers/iio/gyro/st_gyro_buffer.c
index 4ae33ef25b9c..1ebfe7aa6c96 100644
--- a/drivers/iio/gyro/st_gyro_buffer.c
+++ b/drivers/iio/gyro/st_gyro_buffer.c
@@ -7,7 +7,6 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
-#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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics gyroscopes buffer");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/magnetometer/st_magn_buffer.c b/drivers/iio/magnetometer/st_magn_buffer.c
index cb43ccda808d..79987f42e8d9 100644
--- a/drivers/iio/magnetometer/st_magn_buffer.c
+++ b/drivers/iio/magnetometer/st_magn_buffer.c
@@ -7,7 +7,6 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
-#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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics magnetometers buffer");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/pressure/st_pressure_buffer.c b/drivers/iio/pressure/st_pressure_buffer.c
index 25dbd5476b26..0dbf357c2c22 100644
--- a/drivers/iio/pressure/st_pressure_buffer.c
+++ b/drivers/iio/pressure/st_pressure_buffer.c
@@ -7,7 +7,6 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
-#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 <denis.ciocca@st.com>");
-MODULE_DESCRIPTION("STMicroelectronics pressures buffer");
-MODULE_LICENSE("GPL v2");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v2 13/13] iio:st-sensors: Move exports into IIO_ST_SENSORS namespace
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (11 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 12/13] iio:st-sensors: Remove duplicate MODULE_* Jonathan Cameron
@ 2022-01-16 18:05 ` Jonathan Cameron
  2022-01-30 20:01 ` [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
  13 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-16 18:05 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Linus Walleij, Denis Ciocca

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
---
 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(-)

diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index 31ea19d0ba71..55b90833626a 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics accelerometers driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index c0ce78eebad9..ea39de697f9d 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -194,3 +194,4 @@ module_i2c_driver(st_accel_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics accelerometers i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
index b74a1c6d03de..108b63d0146c 100644
--- a/drivers/iio/accel/st_accel_spi.c
+++ b/drivers/iio/accel/st_accel_spi.c
@@ -164,3 +164,4 @@ module_spi_driver(st_accel_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics accelerometers spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/common/st_sensors/st_sensors_buffer.c b/drivers/iio/common/st_sensors/st_sensors_buffer.c
index 5f2b1fb95fd7..e2f108ca949c 100644
--- a/drivers/iio/common/st_sensors/st_sensors_buffer.c
+++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c
@@ -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);
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index eb452d0c423c..fa9bcdf0d190 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics ST-sensors core");
diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index 18bd3c3d99bc..ee95082c7410 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics ST-sensors i2c driver");
diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
index 7c60050e90dc..63e302c3fbaa 100644
--- a/drivers/iio/common/st_sensors/st_sensors_spi.c
+++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics ST-sensors spi driver");
diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c
index ab7a5a24fa6e..899b640c0a70 100644
--- a/drivers/iio/common/st_sensors/st_sensors_trigger.c
+++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c
@@ -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);
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
index 201050b76fe5..62172e18d0d8 100644
--- a/drivers/iio/gyro/st_gyro_core.c
+++ b/drivers/iio/gyro/st_gyro_core.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics gyroscopes driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c
index 163c7ba300c1..8c7af42b6558 100644
--- a/drivers/iio/gyro/st_gyro_i2c.c
+++ b/drivers/iio/gyro/st_gyro_i2c.c
@@ -120,3 +120,4 @@ module_i2c_driver(st_gyro_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics gyroscopes i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c
index b0023f9b9771..22aaabe48e4a 100644
--- a/drivers/iio/gyro/st_gyro_spi.c
+++ b/drivers/iio/gyro/st_gyro_spi.c
@@ -124,3 +124,4 @@ module_spi_driver(st_gyro_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics gyroscopes spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
index 9fb06b7cde3c..ae7bc815382f 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
@@ -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 <andriy.shevchenko@linux.intel.com>");
 MODULE_DESCRIPTION("STMicroelectronics LSM9DS0 IMU core driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index 8f205c477e6f..a90138d8b06a 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -77,3 +77,4 @@ module_i2c_driver(st_lsm9ds0_driver);
 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
 MODULE_DESCRIPTION("STMicroelectronics LSM9DS0 IMU I2C driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
index 0ddfa53166af..b743bf3546a7 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
@@ -76,3 +76,4 @@ module_spi_driver(st_lsm9ds0_driver);
 MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
 MODULE_DESCRIPTION("STMicroelectronics LSM9DS0 IMU SPI driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 0806a1e65ce4..74435f4a427d 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics magnetometers driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
index 7237711fc09b..c5d8c303db4e 100644
--- a/drivers/iio/magnetometer/st_magn_i2c.c
+++ b/drivers/iio/magnetometer/st_magn_i2c.c
@@ -115,3 +115,4 @@ module_i2c_driver(st_magn_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics magnetometers i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
index 489d4462862f..6ddc4318564a 100644
--- a/drivers/iio/magnetometer/st_magn_spi.c
+++ b/drivers/iio/magnetometer/st_magn_spi.c
@@ -106,3 +106,4 @@ module_spi_driver(st_magn_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics magnetometers spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 26a1ee43d56e..5b93933a2e27 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -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 <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics pressures driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 1939e999a427..7035777fd988 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -120,3 +120,4 @@ module_i2c_driver(st_press_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics pressures i2c driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
diff --git a/drivers/iio/pressure/st_pressure_spi.c b/drivers/iio/pressure/st_pressure_spi.c
index d6fc954e28f8..bfab8e7fb061 100644
--- a/drivers/iio/pressure/st_pressure_spi.c
+++ b/drivers/iio/pressure/st_pressure_spi.c
@@ -118,3 +118,4 @@ module_spi_driver(st_press_driver);
 MODULE_AUTHOR("Denis Ciocca <denis.ciocca@st.com>");
 MODULE_DESCRIPTION("STMicroelectronics pressures spi driver");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(IIO_ST_SENSORS);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces
  2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
                   ` (12 preceding siblings ...)
  2022-01-16 18:05 ` [PATCH v2 13/13] iio:st-sensors: Move exports into IIO_ST_SENSORS namespace Jonathan Cameron
@ 2022-01-30 20:01 ` Jonathan Cameron
  2022-02-14 10:18   ` Jonathan Cameron
  13 siblings, 1 reply; 19+ messages in thread
From: Jonathan Cameron @ 2022-01-30 20:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Gwendal Grignou, Mauro Carvalho Chehab,
	Jonathan Cameron, Linus Walleij, Lucas Stankus, Puranjay Mohan,
	Srinivas Pandruvada, Mike Looijmans, Sean Nyekjaer, Denis Ciocca

On Sun, 16 Jan 2022 18:05:22 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

> 
> 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.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
> Cc: Puranjay Mohan <puranjay12@gmail.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Mike Looijmans <mike.looijmans@topic.nl>
> Cc: Sean Nyekjaer <sean@geanix.com>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Denis Ciocca <denis.ciocca@st.com>
> 
> 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(-)
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace
  2022-01-16 18:05 ` [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace Jonathan Cameron
@ 2022-01-31 22:01   ` Sean Nyekjaer
  0 siblings, 0 replies; 19+ messages in thread
From: Sean Nyekjaer @ 2022-01-31 22:01 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Andy Shevchenko, Gwendal Grignou,
	Mauro Carvalho Chehab, Jonathan Cameron

On Sun, Jan 16, 2022 at 06:05:33PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> 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 <Jonathan.Cameron@huawei.com>
> Cc: Sean Nyekjaer <sean@geanix.com>

Looks good :)

Reviewed-by: Sean Nyekjaer <sean@geanix.com>

> ---
>  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(-)
> 
> diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c
> index 32989d91b982..8e763dbf096b 100644
> --- a/drivers/iio/accel/fxls8962af-core.c
> +++ b/drivers/iio/accel/fxls8962af-core.c
> @@ -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 <sean@geanix.com>");
>  MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer driver");
> diff --git a/drivers/iio/accel/fxls8962af-i2c.c b/drivers/iio/accel/fxls8962af-i2c.c
> index cfb004b20455..7e0ecd3bf0d9 100644
> --- a/drivers/iio/accel/fxls8962af-i2c.c
> +++ b/drivers/iio/accel/fxls8962af-i2c.c
> @@ -55,3 +55,4 @@ module_i2c_driver(fxls8962af_driver);
>  MODULE_AUTHOR("Sean Nyekjaer <sean@geanix.com>");
>  MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer i2c driver");
>  MODULE_LICENSE("GPL v2");
> +MODULE_IMPORT_NS(IIO_FXLS8962AF);
> diff --git a/drivers/iio/accel/fxls8962af-spi.c b/drivers/iio/accel/fxls8962af-spi.c
> index 57108d3d480b..0357d54d47cc 100644
> --- a/drivers/iio/accel/fxls8962af-spi.c
> +++ b/drivers/iio/accel/fxls8962af-spi.c
> @@ -55,3 +55,4 @@ module_spi_driver(fxls8962af_driver);
>  MODULE_AUTHOR("Sean Nyekjaer <sean@geanix.com>");
>  MODULE_DESCRIPTION("NXP FXLS8962AF/FXLS8964AF accelerometer spi driver");
>  MODULE_LICENSE("GPL v2");
> +MODULE_IMPORT_NS(IIO_FXLS8962AF);
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces
  2022-01-30 20:01 ` [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
@ 2022-02-14 10:18   ` Jonathan Cameron
  2022-02-14 15:40     ` srinivas pandruvada
  0 siblings, 1 reply; 19+ messages in thread
From: Jonathan Cameron @ 2022-02-14 10:18 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Andy Shevchenko, Gwendal Grignou,
	Mauro Carvalho Chehab, Linus Walleij, Lucas Stankus,
	Puranjay Mohan, Srinivas Pandruvada, Mike Looijmans,
	Sean Nyekjaer, Denis Ciocca

On Sun, 30 Jan 2022 20:01:28 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sun, 16 Jan 2022 18:05:22 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>  
> 
> 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

> 
> Thanks,
> 
> Jonathan
> 
> > 
> > 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.
> > 
> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
> > Cc: Puranjay Mohan <puranjay12@gmail.com>
> > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > Cc: Mike Looijmans <mike.looijmans@topic.nl>
> > Cc: Sean Nyekjaer <sean@geanix.com>
> > Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Denis Ciocca <denis.ciocca@st.com>
> > 
> > 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(-)
> >   
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces
  2022-02-14 10:18   ` Jonathan Cameron
@ 2022-02-14 15:40     ` srinivas pandruvada
  2022-02-18 11:37       ` Jonathan Cameron
  0 siblings, 1 reply; 19+ messages in thread
From: srinivas pandruvada @ 2022-02-14 15:40 UTC (permalink / raw)
  To: Jonathan Cameron, Jonathan Cameron
  Cc: linux-iio, Andy Shevchenko, Gwendal Grignou,
	Mauro Carvalho Chehab, Linus Walleij, Lucas Stankus,
	Puranjay Mohan, Mike Looijmans, Sean Nyekjaer, Denis Ciocca

On Mon, 2022-02-14 at 10:18 +0000, Jonathan Cameron wrote:
> On Sun, 30 Jan 2022 20:01:28 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > On Sun, 16 Jan 2022 18:05:22 +0000
> > Jonathan Cameron <jic23@kernel.org> wrote:
> > 
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>  
> > 
> > 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 :)
I did sanity check, didn't find any issue.

Thanks,
Srinivas

> 
> Thanks,
> 
> Jonathan
> 
> > 
> > Thanks,
> > 
> > Jonathan
> > 
> > > 
> > > 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.
> > > 
> > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
> > > Cc: Puranjay Mohan <puranjay12@gmail.com>
> > > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > Cc: Mike Looijmans <mike.looijmans@topic.nl>
> > > Cc: Sean Nyekjaer <sean@geanix.com>
> > > Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > Cc: Denis Ciocca <denis.ciocca@st.com>
> > > 
> > > 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(-)
> > >   
> > 
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces
  2022-02-14 15:40     ` srinivas pandruvada
@ 2022-02-18 11:37       ` Jonathan Cameron
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Cameron @ 2022-02-18 11:37 UTC (permalink / raw)
  To: srinivas pandruvada
  Cc: Jonathan Cameron, linux-iio, Andy Shevchenko, Gwendal Grignou,
	Mauro Carvalho Chehab, Linus Walleij, Lucas Stankus,
	Puranjay Mohan, Mike Looijmans, Sean Nyekjaer, Denis Ciocca

On Mon, 14 Feb 2022 07:40:24 -0800
srinivas pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> On Mon, 2022-02-14 at 10:18 +0000, Jonathan Cameron wrote:
> > On Sun, 30 Jan 2022 20:01:28 +0000
> > Jonathan Cameron <jic23@kernel.org> wrote:
> >   
> > > On Sun, 16 Jan 2022 18:05:22 +0000
> > > Jonathan Cameron <jic23@kernel.org> wrote:
> > >   
> > > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>    
> > > 
> > > 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 :)  
> 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

> 
> Thanks,
> Srinivas
> 
> > 
> > Thanks,
> > 
> > Jonathan
> >   
> > > 
> > > Thanks,
> > > 
> > > Jonathan
> > >   
> > > > 
> > > > 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.
> > > > 
> > > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
> > > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > > Cc: Lucas Stankus <lucas.p.stankus@gmail.com>
> > > > Cc: Puranjay Mohan <puranjay12@gmail.com>
> > > > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > > Cc: Mike Looijmans <mike.looijmans@topic.nl>
> > > > Cc: Sean Nyekjaer <sean@geanix.com>
> > > > Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> > > > Cc: Linus Walleij <linus.walleij@linaro.org>
> > > > Cc: Denis Ciocca <denis.ciocca@st.com>
> > > > 
> > > > 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(-)
> > > >     
> > >   
> >   
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-02-18 11:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16 18:05 [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 01/13] iio:accel:mma9551_core: Move exports into IIO_MMA9551 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 02/13] iio:accel:mma7455_core: Move exports into IIO_MMA7455 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 03/13] iio:accel:kxsd9: Move exports into IIO_KDSD9 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 04/13] iio:accel:bma400: Move exports into IIO_BMA400 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 05/13] iio:accel:adxl313: Move exports into IIO_ADXL313 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 06/13] iio:accel:adxl345: Move exports into IIO_ADXL345 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 07/13] iio:accel:adxl355: Move exports into IIO_ADXL355 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 08/13] iio:accel:adxl372: Move exports into IIO_ADXL372 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 09/13] iio:accel:bmc150: Move exports into IIO_BMC150 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 10/13] iio:accel:bmi088: Move exports into IIO_BMI088 namespace Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 11/13] iio:accel:fxl8962af: Move exports into IIO_FXL8962AF namespace Jonathan Cameron
2022-01-31 22:01   ` Sean Nyekjaer
2022-01-16 18:05 ` [PATCH v2 12/13] iio:st-sensors: Remove duplicate MODULE_* Jonathan Cameron
2022-01-16 18:05 ` [PATCH v2 13/13] iio:st-sensors: Move exports into IIO_ST_SENSORS namespace Jonathan Cameron
2022-01-30 20:01 ` [PATCH v2 00/13] IIO: accel/st-sensors move into separate symbol namespaces Jonathan Cameron
2022-02-14 10:18   ` Jonathan Cameron
2022-02-14 15:40     ` srinivas pandruvada
2022-02-18 11:37       ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.