Re: [PATCH 3/3] net: dsa: mt7530: add GPIOLIB dependency
From: DENG Qingfang
Date: Thu Feb 25 2021 - 10:53:39 EST
Hi Arnd,
On Thu, Feb 25, 2021 at 10:40 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The new gpio support may be optional at runtime, but it requires
> building against gpiolib:
>
> ERROR: modpost: "gpiochip_get_data" [drivers/net/dsa/mt7530.ko] undefined!
> ERROR: modpost: "devm_gpiochip_add_data_with_key" [drivers/net/dsa/mt7530.ko] undefined!
>
> Add a Kconfig dependency to enforce this.
I think wrapping the GPIO code block with #ifdef CONFIG_GPIOLIB ...
#endif may be a better idea.
>
> Fixes: 429a0edeefd8 ("net: dsa: mt7530: MT7530 optional GPIO support")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>