Patchwork mtd: OneNAND: OMAP2: Return proper error if regulator_get fails

login
register
mail settings
Submitter Axel Lin
Date May 31, 2011, 1:20 p.m.
Message ID <1306848053.13412.1.camel@phoenix>
Download mbox | patch
Permalink /patch/98037/
State New
Headers show

Comments

Axel Lin - May 31, 2011, 1:20 p.m.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mtd/onenand/omap2.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Artem Bityutskiy - June 1, 2011, 11:30 a.m.
On Tue, 2011-05-31 at 21:20 +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/mtd/onenand/omap2.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Pushed to l2-mtd-2.6.git, thank you.

Patch

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index a916dec..0d9073d 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;