Skip to content

Commit 027a697

Browse files
Peter Chenanholt
Peter Chen
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
1 parent 9397776 commit 027a697

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
465465
if (IS_ERR(hdmi->hd_regs))
466466
return PTR_ERR(hdmi->hd_regs);
467467

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-
474468
hdmi->pixel_clock = devm_clk_get(dev, "pixel");
475469
if (IS_ERR(hdmi->pixel_clock)) {
476470
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)
482476
return PTR_ERR(hdmi->hsm_clock);
483477
}
484478

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+
485485
hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
486+
of_node_put(ddc_node);
486487
if (!hdmi->ddc) {
487488
DRM_DEBUG("Failed to get ddc i2c adapter by node\n");
488489
return -EPROBE_DEFER;

0 commit comments

Comments
 (0)