clk: ti: dra7-atl-clock: Fix of_node reference counting

of_find_node_by_name() will call of_node_put() on the node so we need to
get it first to avoid warnings.
The cfg_node needs to be put after we have finished processing the
properties.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Peter Ujfalusi 2016-03-11 16:13:32 +02:00 committed by Stephen Boyd
parent d5630b7a55
commit 660e155193

View File

@ -265,6 +265,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
/* Get configuration for the ATL instances */ /* Get configuration for the ATL instances */
snprintf(prop, sizeof(prop), "atl%u", i); snprintf(prop, sizeof(prop), "atl%u", i);
of_node_get(node);
cfg_node = of_find_node_by_name(node, prop); cfg_node = of_find_node_by_name(node, prop);
if (cfg_node) { if (cfg_node) {
ret = of_property_read_u32(cfg_node, "bws", ret = of_property_read_u32(cfg_node, "bws",
@ -278,6 +279,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
atl_write(cinfo, DRA7_ATL_AWSMUX_REG(i), atl_write(cinfo, DRA7_ATL_AWSMUX_REG(i),
cdesc->aws); cdesc->aws);
} }
of_node_put(cfg_node);
} }
cdesc->probed = true; cdesc->probed = true;