diff mbox

Input: as5011 - fix error return code in as5011_probe()

Message ID CAPgLHd_zTAT7hGkcNCBCzKE5TiXfCYzCysbCDANX2vBDyrpH8A@mail.gmail.com
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 23, 2013, 2:54 a.m. UTC
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/input/joystick/as5011.c | 1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

dmitry.torokhov@gmail.com Aug. 24, 2013, 11:40 p.m. UTC | #1
On Fri, Aug 23, 2013 at 10:54:55AM +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>

Applied, thank you.

> ---
>  drivers/input/joystick/as5011.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
> index 121cd63..262ebe2 100644
> --- a/drivers/input/joystick/as5011.c
> +++ b/drivers/input/joystick/as5011.c
> @@ -288,6 +288,7 @@ static int as5011_probe(struct i2c_client *client,
>  	if (irq < 0) {
>  		dev_err(&client->dev,
>  			"Failed to get irq number for button gpio\n");
> +		error = irq;
>  		goto err_free_button_gpio;
>  	}
>  
>
diff mbox

Patch

diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
index 121cd63..262ebe2 100644
--- a/drivers/input/joystick/as5011.c
+++ b/drivers/input/joystick/as5011.c
@@ -288,6 +288,7 @@  static int as5011_probe(struct i2c_client *client,
 	if (irq < 0) {
 		dev_err(&client->dev,
 			"Failed to get irq number for button gpio\n");
+		error = irq;
 		goto err_free_button_gpio;
 	}