Hi David,
This is remaining missing of_node_put issue fix for gpu/drm drivers, the other fixes I sent yesterday. I think it may be easier for reviewing using patch set for similar issue, thanks.
Peter Chen (7): gpu: drm: rockchip_drm_drv: add missing of_node_put after calling of_parse_phandle gpu: drm: sti_compositor: add missing of_node_put after calling of_parse_phandle gpu: drm: sti_vdo: add missing of_node_put after calling of_parse_phandle gpu: drm: sti_hqvdp: add missing of_node_put after calling of_parse_phandle gpu: drm: sti_vtg: add missing of_node_put after calling of_parse_phandle gpu: drm: sun4i_drv: add missing of_node_put after calling of_parse_phandle gpu: drm: vc4_hdmi: add missing of_node_put after calling of_parse_phandle
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + drivers/gpu/drm/sti/sti_compositor.c | 2 ++ drivers/gpu/drm/sti/sti_dvo.c | 1 + drivers/gpu/drm/sti/sti_hqvdp.c | 1 + drivers/gpu/drm/sti/sti_vtg.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------ 7 files changed, 14 insertions(+), 6 deletions(-)
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Mark Yao mark.yao@rock-chips.com Cc: Heiko Stuebner heiko@sntech.de Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index a409d1f..935c5e0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -518,6 +518,7 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev) is_support_iommu = false; }
+ of_node_put(iommu); component_match_add(dev, &match, compare_of, port->parent); of_node_put(port); }
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/sti/sti_compositor.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 3d2fa3a..064de14 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -247,10 +247,12 @@ static int sti_compositor_probe(struct platform_device *pdev) vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); if (vtg_np) compo->vtg_main = of_vtg_find(vtg_np); + of_node_put(vtg_np);
vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1); if (vtg_np) compo->vtg_aux = of_vtg_find(vtg_np); + of_node_put(vtg_np);
platform_set_drvdata(pdev, compo);
Acked-by: Benjamin Gaignard benjamin.gaignard@linaro.org
2016-07-05 4:04 GMT+02:00 Peter Chen peter.chen@nxp.com:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/sti/sti_compositor.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 3d2fa3a..064de14 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -247,10 +247,12 @@ static int sti_compositor_probe(struct platform_device *pdev) vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); if (vtg_np) compo->vtg_main = of_vtg_find(vtg_np);
of_node_put(vtg_np); vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1); if (vtg_np) compo->vtg_aux = of_vtg_find(vtg_np);
of_node_put(vtg_np); platform_set_drvdata(pdev, compo);
-- 1.9.1
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/sti/sti_dvo.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 25f7663..7e211a8 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -602,6 +602,7 @@ static int sti_dvo_probe(struct platform_device *pdev) dvo->panel_node = of_parse_phandle(np, "sti,panel", 0); if (!dvo->panel_node) DRM_ERROR("No panel associated to the dvo output\n"); + of_node_put(dvo->panel_node);
platform_set_drvdata(pdev, dvo);
Acked-by: Benjamin Gaignard benjamin.gaignard@linaro.org
2016-07-05 4:04 GMT+02:00 Peter Chen peter.chen@nxp.com:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/sti/sti_dvo.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 25f7663..7e211a8 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -602,6 +602,7 @@ static int sti_dvo_probe(struct platform_device *pdev) dvo->panel_node = of_parse_phandle(np, "sti,panel", 0); if (!dvo->panel_node) DRM_ERROR("No panel associated to the dvo output\n");
of_node_put(dvo->panel_node); platform_set_drvdata(pdev, dvo);
-- 1.9.1
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/sti/sti_hqvdp.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 1edec29..4f052fa 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1346,6 +1346,7 @@ static int sti_hqvdp_probe(struct platform_device *pdev) vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); if (vtg_np) hqvdp->vtg = of_vtg_find(vtg_np); + of_node_put(vtg_np);
platform_set_drvdata(pdev, hqvdp);
Acked-by: Benjamin Gaignard benjamin.gaignard@linaro.org
2016-07-05 4:04 GMT+02:00 Peter Chen peter.chen@nxp.com:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/sti/sti_hqvdp.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 1edec29..4f052fa 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1346,6 +1346,7 @@ static int sti_hqvdp_probe(struct platform_device *pdev) vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); if (vtg_np) hqvdp->vtg = of_vtg_find(vtg_np);
of_node_put(vtg_np); platform_set_drvdata(pdev, hqvdp);
-- 1.9.1
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/sti/sti_vtg.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 6bf4ce4..0100c7c 100644 --- a/drivers/gpu/drm/sti/sti_vtg.c +++ b/drivers/gpu/drm/sti/sti_vtg.c @@ -432,6 +432,7 @@ static int vtg_probe(struct platform_device *pdev) np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0); if (np) { vtg->slave = of_vtg_find(np); + of_node_put(np);
if (!vtg->slave) return -EPROBE_DEFER;
Acked-by: Benjamin Gaignard benjamin.gaignard@linaro.org
2016-07-05 4:04 GMT+02:00 Peter Chen peter.chen@nxp.com:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/sti/sti_vtg.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 6bf4ce4..0100c7c 100644 --- a/drivers/gpu/drm/sti/sti_vtg.c +++ b/drivers/gpu/drm/sti/sti_vtg.c @@ -432,6 +432,7 @@ static int vtg_probe(struct platform_device *pdev) np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0); if (np) { vtg->slave = of_vtg_find(np);
of_node_put(np); if (!vtg->slave) return -EPROBE_DEFER;
-- 1.9.1
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Maxime Ripard maxime.ripard@free-electrons.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 76e922b..ca291ba 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -318,6 +318,7 @@ static int sun4i_drv_probe(struct platform_device *pdev)
count += sun4i_drv_add_endpoints(&pdev->dev, &match, pipeline); + of_node_put(pipeline);
DRM_DEBUG_DRIVER("Queued %d outputs on pipeline %d\n", count, i);
On Tue, Jul 05, 2016 at 10:04:53AM +0800, Peter Chen wrote:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Maxime Ripard maxime.ripard@free-electrons.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Peter Chen peter.chen@nxp.com
Applied, thanks! Maxime
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Peter Chen peter.chen@nxp.com --- drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index fd2644d..26b6b06 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) if (IS_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"); if (IS_ERR(hdmi->pixel_clock)) { 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) 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); + of_node_put(ddc_node); if (!hdmi->ddc) { DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); return -EPROBE_DEFER;
Peter Chen peter.chen@nxp.com writes:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index fd2644d..26b6b06 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) if (IS_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"); if (IS_ERR(hdmi->pixel_clock)) { 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) 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);
- of_node_put(ddc_node); if (!hdmi->ddc) { DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); return -EPROBE_DEFER;
--
Reviewed-by: Eric Anholt eric@anholt.net
It would be nice if we could just pass the phandle spec directly to the i2c function. OF code always seems terribly verbose to me (and error-prone in this exact way) because of the separate phandle lookup.
On Tue, Jul 05, 2016 at 09:23:02AM -0700, Eric Anholt wrote:
Peter Chen peter.chen@nxp.com writes:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Peter Chen peter.chen@nxp.com
drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index fd2644d..26b6b06 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) if (IS_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"); if (IS_ERR(hdmi->pixel_clock)) { 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) 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);
- of_node_put(ddc_node); if (!hdmi->ddc) { DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); return -EPROBE_DEFER;
--
Reviewed-by: Eric Anholt eric@anholt.net
It would be nice if we could just pass the phandle spec directly to the i2c function. OF code always seems terribly verbose to me (and error-prone in this exact way) because of the separate phandle lookup.
Yeah, of_find_i2c_adapter_by_phandle would be neat. Either way, applied all the other patches to drm-misc. -Daniel
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Peter Chen peter.chen@nxp.com writes:
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Peter Chen peter.chen@nxp.com
Applied this to drm-vc4-next. Thanks!
dri-devel@lists.freedesktop.org