From 166dc543c2bd9269349c17c5f9143a21ac7d98b3 Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Mon, 11 Apr 2011 10:44:27 +0800 Subject: [PATCH] cyttsp: correct return value for cyttsp suspend/resume func Return 0 for success and < 0 for error, to make them be consistent with kernel convention. Change-Id: I7cb9293833ca4f178e177373c9dd9160d0c303ce Signed-off-by: Hong Liu --- drivers/input/touchscreen/cyttsp_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 3b96715..157786e 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -1343,9 +1343,11 @@ int cyttsp_resume(void *handle) sizeof(xydata), &xydata); if (!(retval < 0) && (GET_HSTMODE(xydata.hst_mode) == - CY_OPERATE_MODE)) + CY_OPERATE_MODE)) { ts->platform_data->power_state = CY_ACTIVE_STATE; + retval = 0; + } } } } @@ -1380,8 +1382,10 @@ int cyttsp_suspend(void *handle) sleep_mode = CY_DEEP_SLEEP_MODE | CY_LOW_POWER_MODE; retval = ttsp_write_block_data(ts, CY_REG_BASE, sizeof(sleep_mode), &sleep_mode); - if (!(retval < 0)) + if (!(retval < 0)) { ts->platform_data->power_state = CY_SLEEP_STATE; + retval = 0; + } } dev_dbg(ts->pdev, "Sleep Power state is %s\n", (ts->platform_data->power_state == CY_ACTIVE_STATE) ? -- 2.7.4