mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
gpio-button-hotplug: fix kernel 5.4 support
This commit is contained in:
parent
ce521963da
commit
b1816c7d0c
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2008-2012 OpenWrt.org
|
# Copyright (C) 2008-2024 OpenWrt.org
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
@ -538,10 +538,14 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
|
|||||||
struct device_node *child =
|
struct device_node *child =
|
||||||
of_get_next_child(dev->of_node, prev);
|
of_get_next_child(dev->of_node, prev);
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||||
bdata->gpiod = devm_fwnode_gpiod_get(dev,
|
bdata->gpiod = devm_fwnode_gpiod_get(dev,
|
||||||
of_fwnode_handle(child), "gpios", GPIOD_IN,
|
of_fwnode_handle(child), "gpios", GPIOD_IN,
|
||||||
desc);
|
desc);
|
||||||
|
#else
|
||||||
|
bdata->gpiod = devm_gpiod_get_from_of_node(dev,
|
||||||
|
child, "gpios", 0, GPIOD_IN, desc);
|
||||||
|
#endif
|
||||||
prev = child;
|
prev = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user