]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm: omap: sdram-nokia: improve error handling
authorAaro Koskinen <aaro.koskinen@nokia.com>
Fri, 17 Dec 2010 23:13:46 +0000 (15:13 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 17 Dec 2010 23:13:46 +0000 (15:13 -0800)
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>
arch/arm/mach-omap2/sdram-nokia.c

index 1171451ef7f2d0dbb16d43dd6d881e1812b5735f..863586bdb98a63f478727b23df2e2515f73aa380 100644 (file)
@@ -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;
 }