Commit d3ed9703 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

video: exynos_dp: add missing of_node_put()

of_find_node_by_name() returns a node pointer with refcount incremented,
use of_node_put() on it when done.

of_find_node_by_name() will call of_node_put() against the node pass to
from parameter, thus we also need to call of_node_get(from) before calling
of_find_node_by_name().
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 678268e5
...@@ -965,10 +965,11 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev) ...@@ -965,10 +965,11 @@ static struct exynos_dp_platdata *exynos_dp_dt_parse_pdata(struct device *dev)
static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
{ {
struct device_node *dp_phy_node; struct device_node *dp_phy_node = of_node_get(dp->dev->of_node);
u32 phy_base; u32 phy_base;
int ret = 0;
dp_phy_node = of_find_node_by_name(dp->dev->of_node, "dptx-phy"); dp_phy_node = of_find_node_by_name(dp_phy_node, "dptx-phy");
if (!dp_phy_node) { if (!dp_phy_node) {
dev_err(dp->dev, "could not find dptx-phy node\n"); dev_err(dp->dev, "could not find dptx-phy node\n");
return -ENODEV; return -ENODEV;
...@@ -976,22 +977,28 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp) ...@@ -976,22 +977,28 @@ static int exynos_dp_dt_parse_phydata(struct exynos_dp_device *dp)
if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) { if (of_property_read_u32(dp_phy_node, "reg", &phy_base)) {
dev_err(dp->dev, "faild to get reg for dptx-phy\n"); dev_err(dp->dev, "faild to get reg for dptx-phy\n");
return -EINVAL; ret = -EINVAL;
goto err;
} }
if (of_property_read_u32(dp_phy_node, "samsung,enable-mask", if (of_property_read_u32(dp_phy_node, "samsung,enable-mask",
&dp->enable_mask)) { &dp->enable_mask)) {
dev_err(dp->dev, "faild to get enable-mask for dptx-phy\n"); dev_err(dp->dev, "faild to get enable-mask for dptx-phy\n");
return -EINVAL; ret = -EINVAL;
goto err;
} }
dp->phy_addr = ioremap(phy_base, SZ_4); dp->phy_addr = ioremap(phy_base, SZ_4);
if (!dp->phy_addr) { if (!dp->phy_addr) {
dev_err(dp->dev, "failed to ioremap dp-phy\n"); dev_err(dp->dev, "failed to ioremap dp-phy\n");
return -ENOMEM; ret = -ENOMEM;
goto err;
} }
return 0; err:
of_node_put(dp_phy_node);
return ret;
} }
static void exynos_dp_phy_init(struct exynos_dp_device *dp) static void exynos_dp_phy_init(struct exynos_dp_device *dp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment