Commit e1d1dfc2 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'tegra-for-4.8-memory' of...

Merge tag 'tegra-for-4.8-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers

memory: tegra: Changes for v4.8-rc1

Contains three reference count fixes from coccinelle.

* tag 'tegra-for-4.8-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  memory: tegra: mc: Add missing of_node_put()
  memory: tegra: Delete unneeded of_node_put()
  memory: tegra: tegra124-emc: Add missing of_node_put()
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 34df3b8b 55bb1d83
...@@ -186,8 +186,10 @@ static int load_timings(struct tegra_mc *mc, struct device_node *node) ...@@ -186,8 +186,10 @@ static int load_timings(struct tegra_mc *mc, struct device_node *node)
timing = &mc->timings[i++]; timing = &mc->timings[i++];
err = load_one_timing(mc, timing, child); err = load_one_timing(mc, timing, child);
if (err) if (err) {
of_node_put(child);
return err; return err;
}
} }
return 0; return 0;
...@@ -206,15 +208,13 @@ static int tegra_mc_setup_timings(struct tegra_mc *mc) ...@@ -206,15 +208,13 @@ static int tegra_mc_setup_timings(struct tegra_mc *mc)
for_each_child_of_node(mc->dev->of_node, node) { for_each_child_of_node(mc->dev->of_node, node) {
err = of_property_read_u32(node, "nvidia,ram-code", err = of_property_read_u32(node, "nvidia,ram-code",
&node_ram_code); &node_ram_code);
if (err || (node_ram_code != ram_code)) { if (err || (node_ram_code != ram_code))
of_node_put(node);
continue; continue;
}
err = load_timings(mc, node); err = load_timings(mc, node);
of_node_put(node);
if (err) if (err)
return err; return err;
of_node_put(node);
break; break;
} }
......
...@@ -970,8 +970,10 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc, ...@@ -970,8 +970,10 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
timing = &emc->timings[i++]; timing = &emc->timings[i++];
err = load_one_timing_from_dt(emc, timing, child); err = load_one_timing_from_dt(emc, timing, child);
if (err) if (err) {
of_node_put(child);
return err; return err;
}
} }
sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings, sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings,
...@@ -995,10 +997,8 @@ tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code) ...@@ -995,10 +997,8 @@ tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
u32 value; u32 value;
err = of_property_read_u32(np, "nvidia,ram-code", &value); err = of_property_read_u32(np, "nvidia,ram-code", &value);
if (err || (value != ram_code)) { if (err || (value != ram_code))
of_node_put(np);
continue; continue;
}
return np; return np;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment