Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad7124: remove __ad7124_set_channel()

Remove __ad7124_set_channel() wrapper function. This just added an
unnecessary layer of indirection with an extra call to container_of().

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
97c8b5de 0b028373

+2 -9
+2 -9
drivers/iio/adc/ad7124.c
··· 656 656 AD7124_CHANNEL_ENABLE); 657 657 } 658 658 659 - static int __ad7124_set_channel(struct ad_sigma_delta *sd, unsigned int channel) 660 - { 661 - struct ad7124_state *st = container_of(sd, struct ad7124_state, sd); 662 - 663 - return ad7124_prepare_read(st, channel); 664 - } 665 - 666 659 static int ad7124_set_channel(struct ad_sigma_delta *sd, unsigned int channel) 667 660 { 668 661 struct ad7124_state *st = container_of(sd, struct ad7124_state, sd); 669 662 int ret; 670 663 671 664 mutex_lock(&st->cfgs_lock); 672 - ret = __ad7124_set_channel(sd, channel); 665 + ret = ad7124_prepare_read(st, channel); 673 666 mutex_unlock(&st->cfgs_lock); 674 667 675 668 return ret; ··· 957 964 for (i = 0; i < st->num_channels; i++) { 958 965 bit_set = test_bit(i, scan_mask); 959 966 if (bit_set) 960 - ret = __ad7124_set_channel(&st->sd, i); 967 + ret = ad7124_prepare_read(st, i); 961 968 else 962 969 ret = ad7124_spi_write_mask(st, AD7124_CHANNEL(i), AD7124_CHANNEL_ENABLE, 963 970 0, 2);