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)
timing = &mc->timings[i++];
err = load_one_timing(mc, timing, child);
if (err)
if (err) {
of_node_put(child);
return err;
}
}
return 0;
......@@ -206,15 +208,13 @@ static int tegra_mc_setup_timings(struct tegra_mc *mc)
for_each_child_of_node(mc->dev->of_node, node) {
err = of_property_read_u32(node, "nvidia,ram-code",
&node_ram_code);
if (err || (node_ram_code != ram_code)) {
of_node_put(node);
if (err || (node_ram_code != ram_code))
continue;
}
err = load_timings(mc, node);
of_node_put(node);
if (err)
return err;
of_node_put(node);
break;
}
......
......@@ -970,8 +970,10 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
timing = &emc->timings[i++];
err = load_one_timing_from_dt(emc, timing, child);
if (err)
if (err) {
of_node_put(child);
return err;
}
}
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)
u32 value;
err = of_property_read_u32(np, "nvidia,ram-code", &value);
if (err || (value != ram_code)) {
of_node_put(np);
if (err || (value != ram_code))
continue;
}
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