From: Axel Lin Date: Tue, 31 May 2011 13:20:53 +0000 (+0800) Subject: mtd: onenand: return proper error if regulator_get fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1c3bd14bb0e10ce69761662d575d454f12070838;p=linux-beck.git mtd: onenand: return proper error if regulator_get fails Signed-off-by: Axel Lin Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index a916dec29215..0d9073d4e417 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -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;