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

From: Linus Walleij
Date: Thu Apr 11 2019 - 09:43:49 EST


On Wed, Apr 10, 2019 at 10:47 AM Yue Haibing <yuehaibing@xxxxxxxxxx> wrote:

> From: YueHaibing <yuehaibing@xxxxxxxxxx>
>
> 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 <hulkci@xxxxxxxxxx>
> Fixes: c97dce792dc8 ("iio: adc: ti-ads7950: add GPIO support")
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij