Skip to content

Commit ea418b3

Browse files
mranostayJiri Kosina
authored andcommitted
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 <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent deb3b88 commit ea418b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ config HID_ALPS
12521252
config HID_MCP2221
12531253
tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
12541254
depends on USB_HID && I2C
1255-
depends on GPIOLIB
1255+
imply GPIOLIB
12561256
help
12571257
Provides I2C and SMBUS host adapter functionality over USB-HID
12581258
through MCP2221 device.

drivers/hid/hid-mcp2221.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,9 +915,11 @@ static int mcp2221_probe(struct hid_device *hdev,
915915
mcp->gc->can_sleep = 1;
916916
mcp->gc->parent = &hdev->dev;
917917

918+
#if IS_REACHABLE(CONFIG_GPIOLIB)
918919
ret = devm_gpiochip_add_data(&hdev->dev, mcp->gc, mcp);
919920
if (ret)
920921
return ret;
922+
#endif
921923

922924
return 0;
923925
}

0 commit comments

Comments
 (0)