Skip to content

Commit

Permalink
Merge tag 'tegra-for-4.8-memory' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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: Olof Johansson <olof@lixom.net>
  • Loading branch information
olofj committed Jul 7, 2016
2 parents 34df3b8 + 55bb1d8 commit e1d1dfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions drivers/memory/tegra/mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/memory/tegra/tegra124-emc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down

0 comments on commit e1d1dfc

Please sign in to comment.