2019-04-10 10:58:59

by Yue Haibing

[permalink] [raw]
Subject: [PATCH] iio: adc: ti-ads7950: Fix build error without CONFIG_GPIOLIB

From: YueHaibing <[email protected]>

When building with CONFIG_GPIOLIB is not set
gcc warns this:

drivers/iio/adc/ti-ads7950.c:75:19: error: field chip has incomplete type
struct gpio_chip chip;
^~~~
drivers/iio/adc/ti-ads7950.c: In function ti_ads7950_set:
drivers/iio/adc/ti-ads7950.c:409:32: error: implicit declaration of function gpiochip_get_data; did you mean acpi_get_data? [-Werror=implicit-function-declaration]
struct ti_ads7950_state *st = gpiochip_get_data(chip);
^~~~~~~~~~~~~~~~~
acpi_get_data

Reported-by: Hulk Robot <[email protected]>
Fixes: c97dce792dc8 ("iio: adc: ti-ads7950: add GPIO support")
Signed-off-by: YueHaibing <[email protected]>
---
drivers/iio/adc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 846c7ac..f760269 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -968,7 +968,7 @@ config TI_ADS1015

config TI_ADS7950
tristate "Texas Instruments ADS7950 ADC driver"
- depends on SPI
+ depends on SPI && GPIOLIB
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
--
2.7.4



2019-04-10 19:57:35

by Justin Chen

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: ti-ads7950: Fix build error without CONFIG_GPIOLIB

On Wed, Apr 10, 2019 at 1:47 AM Yue Haibing <[email protected]> wrote:
>
> From: YueHaibing <[email protected]>
>
> When building with CONFIG_GPIOLIB is not set
> gcc warns this:
>
> drivers/iio/adc/ti-ads7950.c:75:19: error: field chip has incomplete type
> struct gpio_chip chip;
> ^~~~
> drivers/iio/adc/ti-ads7950.c: In function ti_ads7950_set:
> drivers/iio/adc/ti-ads7950.c:409:32: error: implicit declaration of function gpiochip_get_data; did you mean acpi_get_data? [-Werror=implicit-function-declaration]
> struct ti_ads7950_state *st = gpiochip_get_data(chip);
> ^~~~~~~~~~~~~~~~~
> acpi_get_data
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes: c97dce792dc8 ("iio: adc: ti-ads7950: add GPIO support")
> Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Justin Chen <[email protected]>

Thanks,
Justin
> ---
> drivers/iio/adc/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 846c7ac..f760269 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -968,7 +968,7 @@ config TI_ADS1015
>
> config TI_ADS7950
> tristate "Texas Instruments ADS7950 ADC driver"
> - depends on SPI
> + depends on SPI && GPIOLIB
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
> help
> --
> 2.7.4
>
>

2019-04-11 13:44:52

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] iio: adc: ti-ads7950: Fix build error without CONFIG_GPIOLIB

On Wed, Apr 10, 2019 at 10:47 AM Yue Haibing <[email protected]> wrote:

> From: YueHaibing <[email protected]>
>
> When building with CONFIG_GPIOLIB is not set
> gcc warns this:
>
> drivers/iio/adc/ti-ads7950.c:75:19: error: field chip has incomplete type
> struct gpio_chip chip;
> ^~~~
> drivers/iio/adc/ti-ads7950.c: In function ti_ads7950_set:
> drivers/iio/adc/ti-ads7950.c:409:32: error: implicit declaration of function gpiochip_get_data; did you mean acpi_get_data? [-Werror=implicit-function-declaration]
> struct ti_ads7950_state *st = gpiochip_get_data(chip);
> ^~~~~~~~~~~~~~~~~
> acpi_get_data
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes: c97dce792dc8 ("iio: adc: ti-ads7950: add GPIO support")
> Signed-off-by: YueHaibing <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij