Patchwork i2c-pnx: fix error return code in i2c_pnx_probe()

login
register
mail settings
Submitter Wei Yongjun
Date Aug. 23, 2013, 2:55 a.m.
Message ID <CAPgLHd9W5GtFtt6yCHRJ2mmuy2ha2u_utF9jR3yLY5O_oYpLWg@mail.gmail.com>
Download mbox | patch
Permalink /patch/269267/
State Accepted
Headers show

Comments

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

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/i2c/busses/i2c-pnx.c | 1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang - Aug. 23, 2013, 9:02 a.m.
On Fri, Aug 23, 2013 at 10:55:51AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code in the irq get error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to for-current, thanks!
Wolfram Sang - Aug. 28, 2013, 8:30 a.m.
On Fri, Aug 23, 2013 at 10:55:51AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code in the irq get error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Moved it to for-next, since...

> ---
>  drivers/i2c/busses/i2c-pnx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
> index 5f39c6d..d2f02b3 100644
> --- a/drivers/i2c/busses/i2c-pnx.c
> +++ b/drivers/i2c/busses/i2c-pnx.c
> @@ -727,6 +727,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
>  	alg_data->irq = platform_get_irq(pdev, 0);
>  	if (alg_data->irq < 0) {
>  		dev_err(&pdev->dev, "Failed to get IRQ from platform resource\n");
> +		ret = alg_data->irq;
>  		goto out_irq;

... this surely needs to beu 'out_clock'. Fixed it here. If somebody
wants to convert it to devm_*, much appreciated.

>  	}
>  	ret = request_irq(alg_data->irq, i2c_pnx_interrupt,
>

Patch

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 5f39c6d..d2f02b3 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -727,6 +727,7 @@  static int i2c_pnx_probe(struct platform_device *pdev)
 	alg_data->irq = platform_get_irq(pdev, 0);
 	if (alg_data->irq < 0) {
 		dev_err(&pdev->dev, "Failed to get IRQ from platform resource\n");
+		ret = alg_data->irq;
 		goto out_irq;
 	}
 	ret = request_irq(alg_data->irq, i2c_pnx_interrupt,