gpio-button-hotplug: gate off gpio_request_one

Upstream is working towards making GPIOLIB_LEGACY optional. Get ahead of
that by gating off such code as is done upstream.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24985
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
pull/24985/head
Rosen Penev 2026-08-21 14:26:06 -07:00 committed by Jonas Jelonek
parent 0f8cceb469
commit b7d0a5ce14
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gpio-button-hotplug
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -495,6 +495,7 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
goto out;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 18, 0) || IS_ENABLED(CONFIG_GPIOLIB_LEGACY)
if (gpio_is_valid(button->gpio)) {
/* legacy platform data... but is it the lookup table? */
bdata->gpiod = devm_gpiod_get_index(dev, desc, i,
@ -514,7 +515,9 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
gpiod_toggle_active_low(bdata->gpiod);
}
} else {
} else
#endif
{
/* Device-tree */
struct fwnode_handle *child =
device_get_next_child_node(dev, prev);