Skip to content

Commit 5b18920

Browse files
jhovolddtor
authored andcommitted
Input: twl4030-vibra - fix sibling-node lookup
A helper purported to look up a child node based on its name was using the wrong of-helper and ended up prematurely freeing the parent of-node while searching the whole device tree depth-first starting at the parent node. Fixes: 64b9e4d ("input: twl4030-vibra: Support for DT booted kernel") Fixes: e661d0a ("Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning") Cc: stable <[email protected]> # 3.7 Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 02a0d92 commit 5b18920

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/input/misc/twl4030-vibra.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
178178
twl4030_vibra_suspend, twl4030_vibra_resume);
179179

180180
static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
181-
struct device_node *node)
181+
struct device_node *parent)
182182
{
183+
struct device_node *node;
184+
183185
if (pdata && pdata->coexist)
184186
return true;
185187

186-
node = of_find_node_by_name(node, "codec");
188+
node = of_get_child_by_name(parent, "codec");
187189
if (node) {
188190
of_node_put(node);
189191
return true;

0 commit comments

Comments
 (0)