Re: [PATCH] Input: touchscreen: fix kconfig dependency bug for TOUCHSCREEN_ADC

From: Jonathan Cameron
Date: Tue Nov 03 2020 - 05:58:31 EST


On Tue, 3 Nov 2020 01:15:05 +0300
Necip Fazil Yildiran <fazilyildiran@xxxxxxxxx> wrote:

> When TOUCHSCREEN_ADC is enabled and IIO_BUFFER is disabled, it results
> in the following Kbuild warning:
>
> WARNING: unmet direct dependencies detected for IIO_BUFFER_CB
> Depends on [n]: IIO [=y] && IIO_BUFFER [=n]
> Selected by [y]:
> - TOUCHSCREEN_ADC [=y] && !UML && INPUT [=y] && INPUT_TOUCHSCREEN [=y] && IIO [=y]
>
> The reason is that TOUCHSCREEN_ADC selects IIO_BUFFER_CB without depending
> on or selecting IIO_BUFFER while IIO_BUFFER_CB depends on IIO_BUFFER. This
> can also fail building the kernel.
>
> Honor the kconfig dependency to remove unmet direct dependency warnings
> and avoid any potential build failures.
>
> Fixes: aa132ffb6b0a ("input: touchscreen: resistive-adc-touch: add generic resistive ADC touchscreen")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=209881
> Signed-off-by: Necip Fazil Yildiran <fazilyildiran@xxxxxxxxx>

Acked-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

> ---
> drivers/input/touchscreen/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
> index f012fe746df0..cc18f54ea887 100644
> --- a/drivers/input/touchscreen/Kconfig
> +++ b/drivers/input/touchscreen/Kconfig
> @@ -96,6 +96,7 @@ config TOUCHSCREEN_AD7879_SPI
> config TOUCHSCREEN_ADC
> tristate "Generic ADC based resistive touchscreen"
> depends on IIO
> + select IIO_BUFFER
> select IIO_BUFFER_CB
> help
> Say Y here if you want to use the generic ADC