Skip to content

Commit ecd5b50

Browse files
ukleinekjic23
authored andcommitted
iio: adc: ad7124: Benefit of dev = indio_dev->dev.parent in ad7124_parse_channel_config()
Since commit a6eaf02 ("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 <[email protected]> Link: https://patch.msgid.link/v7l2skqj65vbku3ebjsfndfj3atl6iqpodamios2do6q6kcagf@whmuir6fwede Signed-off-by: Jonathan Cameron <[email protected]>
1 parent df1f2e1 commit ecd5b50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/adc/ad7124.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,12 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
10601060
/* Add one for temperature */
10611061
st->num_channels = min(num_channels + 1, AD7124_MAX_CHANNELS);
10621062

1063-
chan = devm_kcalloc(indio_dev->dev.parent, st->num_channels,
1063+
chan = devm_kcalloc(dev, st->num_channels,
10641064
sizeof(*chan), GFP_KERNEL);
10651065
if (!chan)
10661066
return -ENOMEM;
10671067

1068-
channels = devm_kcalloc(indio_dev->dev.parent, st->num_channels, sizeof(*channels),
1068+
channels = devm_kcalloc(dev, st->num_channels, sizeof(*channels),
10691069
GFP_KERNEL);
10701070
if (!channels)
10711071
return -ENOMEM;

0 commit comments

Comments
 (0)