diff options
author | Peter Chen <peter.chen@nxp.com> | 2016-07-04 22:04:54 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-07-07 21:45:11 -0400 |
commit | 027a697677b0d5ff211773596d96f84078ceda80 (patch) | |
tree | a2f782445fa912c5fadfb2a79aaedaaa7705f5d5 | |
parent | 93977767f092fbf0787e5d2a0bf2e0a3fc6f6ced (diff) |
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: Peter Chen <peter.chen@nxp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_hdmi.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index fd2644d231ff..26b6b067567c 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c | |||
@@ -465,12 +465,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) | |||
465 | if (IS_ERR(hdmi->hd_regs)) | 465 | if (IS_ERR(hdmi->hd_regs)) |
466 | return PTR_ERR(hdmi->hd_regs); | 466 | return PTR_ERR(hdmi->hd_regs); |
467 | 467 | ||
468 | ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); | ||
469 | if (!ddc_node) { | ||
470 | DRM_ERROR("Failed to find ddc node in device tree\n"); | ||
471 | return -ENODEV; | ||
472 | } | ||
473 | |||
474 | hdmi->pixel_clock = devm_clk_get(dev, "pixel"); | 468 | hdmi->pixel_clock = devm_clk_get(dev, "pixel"); |
475 | if (IS_ERR(hdmi->pixel_clock)) { | 469 | if (IS_ERR(hdmi->pixel_clock)) { |
476 | DRM_ERROR("Failed to get pixel clock\n"); | 470 | 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 | return PTR_ERR(hdmi->hsm_clock); | 476 | return PTR_ERR(hdmi->hsm_clock); |
483 | } | 477 | } |
484 | 478 | ||
479 | ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); | ||
480 | if (!ddc_node) { | ||
481 | DRM_ERROR("Failed to find ddc node in device tree\n"); | ||
482 | return -ENODEV; | ||
483 | } | ||
484 | |||
485 | hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); | 485 | hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); |
486 | of_node_put(ddc_node); | ||
486 | if (!hdmi->ddc) { | 487 | if (!hdmi->ddc) { |
487 | DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); | 488 | DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); |
488 | return -EPROBE_DEFER; | 489 | return -EPROBE_DEFER; |