Re: [PATCH] iio: adc: ad7173: fix compiling without gpiolib
From: Jonathan Cameron
Date: Sat Apr 26 2025 - 11:16:14 EST
On Tue, 22 Apr 2025 15:12:27 -0500
David Lechner <dlechner@xxxxxxxxxxxx> wrote:
> Fix compiling the ad7173 driver when CONFIG_GPIOLIB is not set by
> selecting GPIOLIB to be always enabled and remove the #if.
>
> Commit 031bdc8aee01 ("iio: adc: ad7173: add calibration support") placed
> unrelated code in the middle of the #if IS_ENABLED(CONFIG_GPIOLIB) block
> which caused the reported compile error.
>
> However, later commit 7530ed2aaa3f ("iio: adc: ad7173: add openwire
> detection support for single conversions") makes use of the gpio regmap
> even when we aren't providing gpio controller support. So it makes more
> sense to always enable GPIOLIB rather than trying to make it optional.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202504220824.HVrTVov1-lkp@xxxxxxxxx/
> Fixes: 031bdc8aee01 ("iio: adc: ad7173: add calibration support")
> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
Applied and marked for stable.
Thanks,
Jonathan