]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: ad7124: Benefit of dev = indio_dev->dev.parent in ad7124_parse_channel_config()
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 4 Mar 2025 09:41:09 +0000 (10:41 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 11 Mar 2025 19:09:16 +0000 (19:09 +0000)
Since commit a6eaf02b8274 ("iio: adc: ad7124: Switch from of specific to
fwnode based property handling") the function
ad7124_parse_channel_config() has a parameter `dev` that holds
the value `indio_dev->dev.parent`. Make use of that to shorten two code
lines.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/v7l2skqj65vbku3ebjsfndfj3atl6iqpodamios2do6q6kcagf@whmuir6fwede
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c

index ad27522f429f3c483c785b21820b886771560f1b..3ea81a98e4553431388139f64d1e426bf0c72988 100644 (file)
@@ -1060,12 +1060,12 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
        /* Add one for temperature */
        st->num_channels = min(num_channels + 1, AD7124_MAX_CHANNELS);
 
-       chan = devm_kcalloc(indio_dev->dev.parent, st->num_channels,
+       chan = devm_kcalloc(dev, st->num_channels,
                            sizeof(*chan), GFP_KERNEL);
        if (!chan)
                return -ENOMEM;
 
-       channels = devm_kcalloc(indio_dev->dev.parent, st->num_channels, sizeof(*channels),
+       channels = devm_kcalloc(dev, st->num_channels, sizeof(*channels),
                                GFP_KERNEL);
        if (!channels)
                return -ENOMEM;