ARM: OMAP2+: gpmc: Error out if timings fail in gpmc_probe_generic_child()
authorRoger Quadros <rogerq@ti.com>
Fri, 29 Aug 2014 16:11:51 +0000 (19:11 +0300)
committerRoger Quadros <rogerq@ti.com>
Thu, 30 Oct 2014 15:20:58 +0000 (17:20 +0200)
gpmc_cs_set_timings() returns non-zero if there was
an error while setting the GPMC timings. e.g. Timing was too
large to be accomodated with current GPMC clock frequency and available
timing range. Fail in this case, else we risk operating a NOR device
with non compliant timings.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc.c

index 45f680f..f5d9dd2 100644 (file)
@@ -1562,7 +1562,12 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
                goto err;
 
        gpmc_read_timings_dt(child, &gpmc_t);
-       gpmc_cs_set_timings(cs, &gpmc_t);
+       ret = gpmc_cs_set_timings(cs, &gpmc_t);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to set gpmc timings for: %s\n",
+                       child->name);
+               goto err;
+       }
 
 no_timings:
        if (of_platform_device_create(child, NULL, &pdev->dev))