2020-04-28 21:33:14

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] HID: mcp2221: add gpiolib dependency

Without gpiolib, this driver fails to link:

arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp2221_probe':
hid-mcp2221.c:(.text+0x1b0): undefined reference to `devm_gpiochip_add_data'
arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp_gpio_get':
hid-mcp2221.c:(.text+0x30c): undefined reference to `gpiochip_get_data'

Fixes: 328de1c519c5 ("HID: mcp2221: add GPIO functionality support")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/hid/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 008bf44bc2c3..d54e7ae80de5 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -1155,6 +1155,7 @@ config HID_ALPS
config HID_MCP2221
tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
depends on USB_HID && I2C
+ depends on GPIOLIB
---help---
Provides I2C and SMBUS host adapter functionality over USB-HID
through MCP2221 device.
--
2.26.0


2020-04-29 03:13:14

by rishi gupta

[permalink] [raw]
Subject: Re: [PATCH] HID: mcp2221: add gpiolib dependency

Thanks Arnd, How about one liner:
depends on USB_HID && I2C && GPIOLIB

Reviewed-by: Rishi Gupta <[email protected]>


On Wed, Apr 29, 2020 at 3:00 AM Arnd Bergmann <[email protected]> wrote:
>
> Without gpiolib, this driver fails to link:
>
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp2221_probe':
> hid-mcp2221.c:(.text+0x1b0): undefined reference to `devm_gpiochip_add_data'
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp_gpio_get':
> hid-mcp2221.c:(.text+0x30c): undefined reference to `gpiochip_get_data'
>
> Fixes: 328de1c519c5 ("HID: mcp2221: add GPIO functionality support")
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/hid/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 008bf44bc2c3..d54e7ae80de5 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -1155,6 +1155,7 @@ config HID_ALPS
> config HID_MCP2221
> tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
> depends on USB_HID && I2C
> + depends on GPIOLIB
> ---help---
> Provides I2C and SMBUS host adapter functionality over USB-HID
> through MCP2221 device.
> --
> 2.26.0
>

2020-04-29 12:24:35

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] HID: mcp2221: add gpiolib dependency

On Tue, Apr 28, 2020 at 11:30 PM Arnd Bergmann <[email protected]> wrote:

> Without gpiolib, this driver fails to link:
>
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp2221_probe':
> hid-mcp2221.c:(.text+0x1b0): undefined reference to `devm_gpiochip_add_data'
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp_gpio_get':
> hid-mcp2221.c:(.text+0x30c): undefined reference to `gpiochip_get_data'
>
> Fixes: 328de1c519c5 ("HID: mcp2221: add GPIO functionality support")
> Signed-off-by: Arnd Bergmann <[email protected]>

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

> config HID_MCP2221
> tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
> depends on USB_HID && I2C
> + depends on GPIOLIB

These days we can even do select GPIOLIB, but I suppose
that would make the driver selectable on platforms with no
native GPIO support at all (like UM) so I suppose this
is better.

Yours,
Linus Walleij

2020-04-29 19:50:09

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] HID: mcp2221: add gpiolib dependency

On Tue, 28 Apr 2020, Arnd Bergmann wrote:

> Without gpiolib, this driver fails to link:
>
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp2221_probe':
> hid-mcp2221.c:(.text+0x1b0): undefined reference to `devm_gpiochip_add_data'
> arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp_gpio_get':
> hid-mcp2221.c:(.text+0x30c): undefined reference to `gpiochip_get_data'
>
> Fixes: 328de1c519c5 ("HID: mcp2221: add GPIO functionality support")
> Signed-off-by: Arnd Bergmann <[email protected]>

Applied, thanks Arnd.

--
Jiri Kosina
SUSE Labs