summaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2018-01-09 02:15:06 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-01-09 02:40:52 +0100
commit5b189201993ab03001a398de731045bfea90c689 (patch)
tree4a40a7f02e4abba352bf42020b5484bc8ec6eac0 /drivers/input/misc
parentInput: xen-kbdfront - do not advertise multi-touch pressure support (diff)
downloadlinux-5b189201993ab03001a398de731045bfea90c689.tar.xz
linux-5b189201993ab03001a398de731045bfea90c689.zip
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: 64b9e4d803b1 ("input: twl4030-vibra: Support for DT booted kernel") Fixes: e661d0a04462 ("Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning") Cc: stable <stable@vger.kernel.org> # 3.7 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/twl4030-vibra.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 6c51d404874b..c37aea9ac272 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -178,12 +178,14 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
twl4030_vibra_suspend, twl4030_vibra_resume);
static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
- struct device_node *node)
+ struct device_node *parent)
{
+ struct device_node *node;
+
if (pdata && pdata->coexist)
return true;
- node = of_find_node_by_name(node, "codec");
+ node = of_get_child_by_name(parent, "codec");
if (node) {
of_node_put(node);
return true;