]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
gpio-button-hotplug: remove LINUX_VERSION_CODE 22925/head
authorRosen Penev <rosenp@gmail.com>
Tue, 14 Apr 2026 02:56:00 +0000 (19:56 -0700)
committerRobert Marko <robimarko@gmail.com>
Wed, 15 Apr 2026 08:04:13 +0000 (10:04 +0200)
The 6.18 code works with older kernels as well. Remove the older section
and use the newer one always.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22925
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

index 8ba1c64b9768d4068126ddb8e93eb8ac1c30e8c1..89cdeea0d93cc6b80bb762d130ed852cd3c1528f 100644 (file)
@@ -513,15 +513,8 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
                                                            GPIOD_IN);
                        if (IS_ERR(bdata->gpiod)) {
                                /* or the legacy (button->gpio is good) way? */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(6,18,0)
-                               error = devm_gpio_request_one(dev,
-                                       button->gpio, GPIOF_IN | (
-                                       button->active_low ? GPIOF_ACTIVE_LOW :
-                                       0), desc);
-#else
                                error = devm_gpio_request_one(dev,
                                        button->gpio, GPIOF_IN, desc);
-#endif
                                if (error) {
                                        dev_err_probe(dev, error,
                                                      "unable to claim gpio %d",
@@ -530,10 +523,8 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
                                }
 
                                bdata->gpiod = gpio_to_desc(button->gpio);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,18,0)
                                if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
                                        gpiod_toggle_active_low(bdata->gpiod);
-#endif
                        }
                } else {
                        /* Device-tree */