mtd: onenand: return proper error if regulator_get fails
authorAxel Lin <axel.lin@gmail.com>
Tue, 31 May 2011 13:20:53 +0000 (21:20 +0800)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 15 Aug 2011 10:26:38 +0000 (13:26 +0300)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/onenand/omap2.c

index a916dec..0d9073d 100644 (file)
@@ -741,6 +741,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
                c->regulator = regulator_get(&pdev->dev, "vonenand");
                if (IS_ERR(c->regulator)) {
                        dev_err(&pdev->dev,  "Failed to get regulator\n");
+                       r = PTR_ERR(c->regulator);
                        goto err_release_dma;
                }
                c->onenand.enable = omap2_onenand_enable;