brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch
1 From cededb2870ab15fcf79f063a83f5f37421e5bdfc Mon Sep 17 00:00:00 2001
2 From: Peter Chen <peter.chen@nxp.com>
3 Date: Tue, 5 Jul 2016 10:04:54 +0800
4 Subject: [PATCH] gpu: drm: vc4_hdmi: add missing of_node_put after calling
5 of_parse_phandle
6
7 of_node_put needs to be called when the device node which is got
8 from of_parse_phandle has finished using.
9
10 Signed-off-by: Peter Chen <peter.chen@nxp.com>
11 Reviewed-by: Eric Anholt <eric@anholt.net>
12 (cherry picked from commit 027a697677b0d5ff211773596d96f84078ceda80)
13 ---
14 drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------
15 1 file changed, 7 insertions(+), 6 deletions(-)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -467,12 +467,6 @@ static int vc4_hdmi_bind(struct device *
20 if (IS_ERR(hdmi->hd_regs))
21 return PTR_ERR(hdmi->hd_regs);
22
23 - ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
24 - if (!ddc_node) {
25 - DRM_ERROR("Failed to find ddc node in device tree\n");
26 - return -ENODEV;
27 - }
28 -
29 hdmi->pixel_clock = devm_clk_get(dev, "pixel");
30 if (IS_ERR(hdmi->pixel_clock)) {
31 DRM_ERROR("Failed to get pixel clock\n");
32 @@ -484,7 +478,14 @@ static int vc4_hdmi_bind(struct device *
33 return PTR_ERR(hdmi->hsm_clock);
34 }
35
36 + ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
37 + if (!ddc_node) {
38 + DRM_ERROR("Failed to find ddc node in device tree\n");
39 + return -ENODEV;
40 + }
41 +
42 hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
43 + of_node_put(ddc_node);
44 if (!hdmi->ddc) {
45 DRM_DEBUG("Failed to get ddc i2c adapter by node\n");
46 return -EPROBE_DEFER;