Skip to content

Commit

Permalink
arm: omap: sdram-nokia: improve error handling
Browse files Browse the repository at this point in the history
Actually check for errors: print an error log and return NULL.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Aaro Koskinen authored and Tony Lindgren committed Dec 17, 2010
1 parent e5f5b54 commit 2b1af87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/arm/mach-omap2/sdram-nokia.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ struct omap_sdrc_params *nokia_get_sdram_timings(void)
int err = 0;
int i;

for (i = 0; i < ARRAY_SIZE(nokia_timings); i++)
for (i = 0; i < ARRAY_SIZE(nokia_timings); i++) {
err |= sdrc_timings(i, nokia_timings[i].rate,
nokia_timings[i].data);
if (err)
pr_err("%s: error with rate %ld: %d\n", __func__,
nokia_timings[i].rate, err);
}

return &nokia_sdrc_params[0];
return err ? NULL : nokia_sdrc_params;
}

0 comments on commit 2b1af87

Please sign in to comment.