diff mbox series

[1/5,v2] iio: st_sensors: Create extended attr macro

Message ID 20210517233322.383043-1-linus.walleij@linaro.org (mailing list archive)
State Superseded
Headers show
Series [1/5,v2] iio: st_sensors: Create extended attr macro | expand

Commit Message

Linus Walleij May 17, 2021, 11:33 p.m. UTC
Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
specialized version of the former.

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Cc: Daniel Drake <drake@endlessm.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- New helper patch from Stephan.
---
 include/linux/iio/common/st_sensors.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Andy Shevchenko May 18, 2021, 9:04 a.m. UTC | #1
On Tue, May 18, 2021 at 01:33:18AM +0200, Linus Walleij wrote:
> Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
> attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
> specialized version of the former.

Missed to Cc Hans?

Btw, I have scripted the series submission [1]. Feel free to use it, I found it
much easier and less error prone (like forgetting maintainers or key contributors).

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh
Andy Shevchenko May 18, 2021, 11:07 a.m. UTC | #2
On Tue, May 18, 2021 at 01:33:18AM +0200, Linus Walleij wrote:
> Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
> attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
> specialized version of the former.

After addressing comments

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

for the entire series.

P.S. I think I can send one patch that should prepend your series, stay tuned!
diff mbox series

Patch

diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 33e939977444..704217a5c3ba 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -46,8 +46,8 @@ 
 #define ST_SENSORS_MAX_NAME			17
 #define ST_SENSORS_MAX_4WAI			8
 
-#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
-					ch2, s, endian, rbits, sbits, addr) \
+#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
+				    ch2, s, endian, rbits, sbits, addr, ext) \
 { \
 	.type = device_type, \
 	.modified = mod, \
@@ -63,8 +63,14 @@ 
 		.storagebits = sbits, \
 		.endianness = endian, \
 	}, \
+	.ext_info = ext, \
 }
 
+#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
+				ch2, s, endian, rbits, sbits, addr)	\
+	ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod,	\
+				    ch2, s, endian, rbits, sbits, addr, NULL)
+
 #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \
 		IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \
 			st_sensors_sysfs_sampling_frequency_avail)