]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.103/clk-ti-dra7-atl-clock-fix-of_node-reference-counting.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.103 / clk-ti-dra7-atl-clock-fix-of_node-reference-counting.patch
1 From 660e1551939931657808d47838a3f443c0e83fd0 Mon Sep 17 00:00:00 2001
2 From: Peter Ujfalusi <peter.ujfalusi@ti.com>
3 Date: Fri, 11 Mar 2016 16:13:32 +0200
4 Subject: clk: ti: dra7-atl-clock: Fix of_node reference counting
5
6 From: Peter Ujfalusi <peter.ujfalusi@ti.com>
7
8 commit 660e1551939931657808d47838a3f443c0e83fd0 upstream.
9
10 of_find_node_by_name() will call of_node_put() on the node so we need to
11 get it first to avoid warnings.
12 The cfg_node needs to be put after we have finished processing the
13 properties.
14
15 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
16 Tested-by: Nishanth Menon <nm@ti.com>
17 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/clk/ti/clk-dra7-atl.c | 2 ++
22 1 file changed, 2 insertions(+)
23
24 --- a/drivers/clk/ti/clk-dra7-atl.c
25 +++ b/drivers/clk/ti/clk-dra7-atl.c
26 @@ -265,6 +265,7 @@ static int of_dra7_atl_clk_probe(struct
27
28 /* Get configuration for the ATL instances */
29 snprintf(prop, sizeof(prop), "atl%u", i);
30 + of_node_get(node);
31 cfg_node = of_find_node_by_name(node, prop);
32 if (cfg_node) {
33 ret = of_property_read_u32(cfg_node, "bws",
34 @@ -278,6 +279,7 @@ static int of_dra7_atl_clk_probe(struct
35 atl_write(cinfo, DRA7_ATL_AWSMUX_REG(i),
36 cdesc->aws);
37 }
38 + of_node_put(cfg_node);
39 }
40
41 cdesc->probed = true;