Skip to content

Commit

Permalink
Input: twl6040-vibra - add missing of_node_put
Browse files Browse the repository at this point in the history
We should drop reference to twl6040_core_node device_node once we are done
using it.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Libo Chen authored and Dmitry Torokhov committed Jan 4, 2014
1 parent a9e1d3c commit f048dd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/input/misc/twl6040-vibra.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)

info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
if (!info) {
of_node_put(twl6040_core_node);
dev_err(&pdev->dev, "couldn't allocate memory\n");
return -ENOMEM;
}
Expand All @@ -295,6 +296,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", &vddvibl_uV);
of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV);

of_node_put(twl6040_core_node);

if ((!info->vibldrv_res && !info->viblmotor_res) ||
(!info->vibrdrv_res && !info->vibrmotor_res)) {
dev_err(info->dev, "invalid vibra driver/motor resistance\n");
Expand Down

0 comments on commit f048dd1

Please sign in to comment.