]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: Convert to IIO_MAP()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 7 Sep 2024 17:24:47 +0000 (19:24 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:21:02 +0000 (09:21 +0100)
commit51bedd7b98f95515a790a84198ed3c898124811f
treef229f8f2b9c0ff160cada8df8f3a5d0f35d2ab89
parentfaf178607772f28006e403d7bab6c4217d4ee447
iio: adc: Convert to IIO_MAP()

Use IIO_MAP() instead of hand-writing it. It is much less verbose.

The change has been do with the following coccinelle script:

@@
identifier STRUCT_NAME;
constant NAME, CHANNEL, LABEL;
@@

static const struct iio_map STRUCT_NAME[] = {
...,
- {
- .consumer_dev_name = NAME,
- .consumer_channel = CHANNEL,
- .adc_channel_label = LABEL,
- },
+ IIO_MAP(LABEL, NAME, CHANNEL),
...
};

@@
identifier STRUCT_NAME;
constant NAME, LABEL;
@@

static const struct iio_map STRUCT_NAME[] = {
...,
- {
- .consumer_dev_name = NAME,
- .adc_channel_label = LABEL,
- },
+ IIO_MAP(LABEL, NAME, NULL),
...
};

--
Compile tested only

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/48f08224fab5a7595f650dbcef012d7cac3f972b.1725729801.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/axp20x_adc.c
drivers/iio/adc/da9150-gpadc.c
drivers/iio/adc/lp8788_adc.c
drivers/iio/adc/sun4i-gpadc-iio.c