Patchwork [v2] mtd: fsmc_nand: fix error return code in fsmc_nand_probe()

login
register
mail settings
Submitter Wei Yongjun
Date May 14, 2013, 2:30 a.m.
Message ID <CAPgLHd_DjX-Bfdf9p6k2t_fy+SjgQanuJjX_WxA1tqewwRe1HA@mail.gmail.com>
Download mbox | patch
Permalink /patch/243582/
State New
Headers show

Comments

Wei Yongjun - May 14, 2013, 2:30 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENODEV in the dma channel request error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
v1 -> v2: set ret for error cases only
---
 drivers/mtd/nand/fsmc_nand.c | 2 ++
 1 file changed, 2 insertions(+)
viresh kumar - May 14, 2013, 4 a.m.
On 14 May 2013 08:00, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return -ENODEV in the dma channel request error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> v1 -> v2: set ret for error cases only
> ---
>  drivers/mtd/nand/fsmc_nand.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
> index 0e5a1d9..95e1768 100644
> --- a/drivers/mtd/nand/fsmc_nand.c
> +++ b/drivers/mtd/nand/fsmc_nand.c
> @@ -1035,12 +1035,14 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
>                 host->read_dma_chan = dma_request_channel(mask, filter,
>                                 pdata->read_dma_priv);
>                 if (!host->read_dma_chan) {
> +                       ret = -ENODEV;
>                         dev_err(&pdev->dev, "Unable to get read dma channel\n");
>                         goto err_req_read_chnl;
>                 }
>                 host->write_dma_chan = dma_request_channel(mask, filter,
>                                 pdata->write_dma_priv);
>                 if (!host->write_dma_chan) {
> +                       ret = -ENODEV;
>                         dev_err(&pdev->dev, "Unable to get write dma channel\n");
>                         goto err_req_write_chnl;
>                 }
>

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Patch

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 0e5a1d9..95e1768 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -1035,12 +1035,14 @@  static int __init fsmc_nand_probe(struct platform_device *pdev)
 		host->read_dma_chan = dma_request_channel(mask, filter,
 				pdata->read_dma_priv);
 		if (!host->read_dma_chan) {
+			ret = -ENODEV;
 			dev_err(&pdev->dev, "Unable to get read dma channel\n");
 			goto err_req_read_chnl;
 		}
 		host->write_dma_chan = dma_request_channel(mask, filter,
 				pdata->write_dma_priv);
 		if (!host->write_dma_chan) {
+			ret = -ENODEV;
 			dev_err(&pdev->dev, "Unable to get write dma channel\n");
 			goto err_req_write_chnl;
 		}