From 1c3bd14bb0e10ce69761662d575d454f12070838 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 31 May 2011 21:20:53 +0800 Subject: [PATCH] mtd: onenand: return proper error if regulator_get fails Signed-off-by: Axel Lin Signed-off-by: Artem Bityutskiy --- drivers/mtd/onenand/omap2.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.34.1