]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: mcp2221: change 'select GPIOLIB' to imply
authorMatt Ranostay <matt.ranostay@konsulko.com>
Sat, 1 Oct 2022 00:52:07 +0000 (17:52 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 18 Oct 2022 13:00:01 +0000 (15:00 +0200)
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 <matt.ranostay@konsulko.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/Kconfig
drivers/hid/hid-mcp2221.c

index 185a077d59cdd10063d834208845ad033359c353..745fc38794ad7d8ff596ed478769108db567aae5 100644 (file)
@@ -1252,7 +1252,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.
index 4d10a24e3e130e40275e7220b9a43c52813de047..fb54f1c6fd9c8ff31fe6f361c59adc1ab9046549 100644 (file)
@@ -915,9 +915,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;
 }