diff mbox

[-next] Input: zforce - fix error return code in zforce_start()

Message ID CAPgLHd8WBR38qd9VHfazXVTbuoJ=GPOafHzSz8d9XJ-F61a7nQ@mail.gmail.com
State New, archived
Headers show

Commit Message

Wei Yongjun Dec. 17, 2013, 3:27 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The error code was not set if unable to set config, so the error
condition wasn't reflected in the return value. Fix to return a
negative error code from the error handling case instead of 0.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/input/touchscreen/zforce_ts.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
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

Heiko Stübner Dec. 17, 2013, 3:06 p.m. UTC | #1
Am Dienstag, 17. Dezember 2013, 04:27:16 schrieb Wei Yongjun:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> The error code was not set if unable to set config, so the error
> condition wasn't reflected in the return value. Fix to return a
> negative error code from the error handling case instead of 0.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thanks for the catch.

Acked-by: Heiko Stuebner <heiko@sntech.de>
--
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
dmitry.torokhov@gmail.com Dec. 18, 2013, 4:50 p.m. UTC | #2
On Tue, Dec 17, 2013 at 04:06:49PM +0100, Heiko Stübner wrote:
> Am Dienstag, 17. Dezember 2013, 04:27:16 schrieb Wei Yongjun:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > 
> > The error code was not set if unable to set config, so the error
> > condition wasn't reflected in the return value. Fix to return a
> > negative error code from the error handling case instead of 0.
> > 
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Thanks for the catch.
> 
> Acked-by: Heiko Stuebner <heiko@sntech.de>

Applied, thank you.
diff mbox

Patch

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index aa127ba..2175f34 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -279,7 +279,8 @@  static int zforce_start(struct zforce_ts *ts)
 		goto error;
 	}
 
-	if (zforce_setconfig(ts, SETCONFIG_DUALTOUCH)) {
+	ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH);
+	if (ret) {
 		dev_err(&client->dev, "Unable to set config\n");
 		goto error;
 	}