Patchwork [-next] mtd: atmel_nand: fix error return code in atmel_nand_probe()

login
register
mail settings
Submitter Wei Yongjun
Date Aug. 23, 2013, 2:50 a.m.
Message ID <CAPgLHd8an7_iEV1eTNGFmQ8B4CM=FGu0jrov_A=L9JRJ8AFKPA@mail.gmail.com>
Download mbox | patch
Permalink /patch/269266/
State New
Headers show

Comments

Wei Yongjun - Aug. 23, 2013, 2:50 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/mtd/nand/atmel_nand.c | 1 +
 1 file changed, 1 insertion(+)
Wu, Josh - Aug. 23, 2013, 3:53 a.m.
On 8/23/2013 10:50 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thank you for catch this. And
Acked-by: Josh Wu <josh.wu@atmel.com>

> ---
>   drivers/mtd/nand/atmel_nand.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 65b302c..093bcf8 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -2047,6 +2047,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
>   		irq = platform_get_irq(pdev, 0);
>   		if (irq < 0) {
>   			dev_err(host->dev, "Cannot get HSMC irq!\n");
> +			res = irq;
>   			goto err_nand_ioremap;
>   		}
>   
>
Wu, Josh - Aug. 23, 2013, 3:54 a.m.
Hi, Wei Yongjun

On 8/23/2013 10:50 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thank you for catch this and
Acked-by: Josh Wu <josh.wu@atmel.com>

> ---
>   drivers/mtd/nand/atmel_nand.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 65b302c..093bcf8 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -2047,6 +2047,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
>   		irq = platform_get_irq(pdev, 0);
>   		if (irq < 0) {
>   			dev_err(host->dev, "Cannot get HSMC irq!\n");
> +			res = irq;
>   			goto err_nand_ioremap;
>   		}
>   
>

Best Regards,
Josh Wu
Brian Norris - Aug. 24, 2013, 4:44 a.m.
On Fri, Aug 23, 2013 at 10:50:36AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Pushed to l2-mtd.git. Thanks!

Brian

Patch

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 65b302c..093bcf8 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -2047,6 +2047,7 @@  static int __init atmel_nand_probe(struct platform_device *pdev)
 		irq = platform_get_irq(pdev, 0);
 		if (irq < 0) {
 			dev_err(host->dev, "Cannot get HSMC irq!\n");
+			res = irq;
 			goto err_nand_ioremap;
 		}