lkml.org 
[lkml]   [2023]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 2/3] input: gpio-keys - add device links of children
Date
Since the child nodes of gpio-keys are implemented by the
gpio-keys device driver, that driver should explicitly create
the appropriate device links to support proper device power
management and shutdown sequencing.

Fixes: f9aa460672c9 ("driver core: Refactor fw_devlink feature")
Signed-off-by: Doug Berger <opendmb@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 0516c6279d8a..7a0dcfeb02dc 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -865,6 +865,7 @@ static int gpio_keys_probe(struct platform_device *pdev)

for (i = 0; i < pdata->nbuttons; i++) {
const struct gpio_keys_button *button = &pdata->buttons[i];
+ struct fwnode_link *link;

if (!dev_get_platdata(dev)) {
child = device_get_next_child_node(dev, child);
@@ -882,6 +883,12 @@ static int gpio_keys_probe(struct platform_device *pdev)
fwnode_handle_put(child);
return error;
}
+ if (child) {
+ list_for_each_entry(link, &child->suppliers, c_hook) {
+ device_link_add(dev, link->supplier->dev,
+ DL_FLAG_AUTOREMOVE_CONSUMER);
+ }
+ }

if (button->wakeup)
wakeup = 1;
--
2.34.1
\
 
 \ /
  Last update: 2023-04-28 00:18    [W:0.332 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site