From 3e77bf1bb41285219ddf7ac69c6fb29d3d1ea4dc Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Fri, 30 Sep 2022 17:52:07 -0700 Subject: [PATCH] ODROID-C5: HID: mcp2221: change 'select GPIOLIB' to imply To avoid recursive dependencies on GPIOLIB when 'imply IIO' is requested with other drivers we should switch GPIOLIB to an imply. This isn't the most ideal solution but avoids modifiying the Kconfig for other drivers, and only requires a singular IS_REACHABLE(CONFIG_GPIOLIB) check. Signed-off-by: Matt Ranostay Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Change-Id: Ie379ae18bd2aae09b576238298715055ca616f0d --- drivers/hid/Kconfig | 2 +- drivers/hid/hid-mcp2221.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index df1740750e3d..8cc0d8724dfc 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -1225,7 +1225,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 + imply GPIOLIB help Provides I2C and SMBUS host adapter functionality over USB-HID through MCP2221 device. diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index 1b111b8185d4..63c69087813d 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -921,9 +921,11 @@ static int mcp2221_probe(struct hid_device *hdev, mcp->gc->can_sleep = 1; mcp->gc->parent = &hdev->dev; +#if IS_REACHABLE(CONFIG_GPIOLIB) ret = devm_gpiochip_add_data(&hdev->dev, mcp->gc, mcp); if (ret) return ret; +#endif return 0; }