mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
clk: tegra: tegra124-emc: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
1acce02756
commit
2ea99dade5
|
|
@ -444,7 +444,6 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra,
|
|||
u32 ram_code)
|
||||
{
|
||||
struct emc_timing *timings_ptr;
|
||||
struct device_node *child;
|
||||
int child_count = of_get_child_count(node);
|
||||
int i = 0, err;
|
||||
size_t size;
|
||||
|
|
@ -458,12 +457,11 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra,
|
|||
timings_ptr = tegra->timings + tegra->num_timings;
|
||||
tegra->num_timings += child_count;
|
||||
|
||||
for_each_child_of_node(node, child) {
|
||||
for_each_child_of_node_scoped(node, child) {
|
||||
struct emc_timing *timing = timings_ptr + (i++);
|
||||
|
||||
err = load_one_timing_from_dt(tegra, timing, child);
|
||||
if (err) {
|
||||
of_node_put(child);
|
||||
kfree(tegra->timings);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user