Commit 027a6976 authored by Peter Chen's avatar Peter Chen Committed by Eric Anholt

gpu: drm: vc4_hdmi: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
parent 93977767
...@@ -465,12 +465,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) ...@@ -465,12 +465,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
if (IS_ERR(hdmi->hd_regs)) if (IS_ERR(hdmi->hd_regs))
return PTR_ERR(hdmi->hd_regs); return PTR_ERR(hdmi->hd_regs);
ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
if (!ddc_node) {
DRM_ERROR("Failed to find ddc node in device tree\n");
return -ENODEV;
}
hdmi->pixel_clock = devm_clk_get(dev, "pixel"); hdmi->pixel_clock = devm_clk_get(dev, "pixel");
if (IS_ERR(hdmi->pixel_clock)) { if (IS_ERR(hdmi->pixel_clock)) {
DRM_ERROR("Failed to get pixel clock\n"); DRM_ERROR("Failed to get pixel clock\n");
...@@ -482,7 +476,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) ...@@ -482,7 +476,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(hdmi->hsm_clock); return PTR_ERR(hdmi->hsm_clock);
} }
ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
if (!ddc_node) {
DRM_ERROR("Failed to find ddc node in device tree\n");
return -ENODEV;
}
hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
of_node_put(ddc_node);
if (!hdmi->ddc) { if (!hdmi->ddc) {
DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); DRM_DEBUG("Failed to get ddc i2c adapter by node\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
......
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