diff mbox

[v1,1/1] Input: elantech - Remove the ETP_SAMPLE_QUERY read that is now redundant

Message ID 1440279820-30996-1-git-send-email-ulrik.debie-os@e2big.org (mailing list archive)
State New, archived
Headers show

Commit Message

Ulrik De Bie Aug. 22, 2015, 9:43 p.m. UTC
commit 6b30c73e9f37183ad60c7f7050acf8e8edf91e9c introduced a read of
ETP_SAMPLE_QUERY to etd->samples on line 1662. Because of that
introduction, this other read of ETP_SAMPLE_QUERY at line 1040 becomes
redundant and the already read etd->samples can be used instead.

This line 1040 read will only be called when
(etd->fw_version >> 16) == 0x14 and consequentially
hardware version != 1 so the line 1662 read is also called.

Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
CC: Duson Lin <dusonlin@emc.com.tw>
---
 drivers/input/mouse/elantech.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 2955f1d..825be4b 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1037,11 +1037,10 @@  static int elantech_set_range(struct psmouse *psmouse,
 			fixed_dpi = param[1] & 0x10;
 
 			if (((etd->fw_version >> 16) == 0x14) && fixed_dpi) {
-				if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, param))
-					return -1;
-
-				*x_max = (etd->capabilities[1] - i) * param[1] / 2;
-				*y_max = (etd->capabilities[2] - i) * param[2] / 2;
+				*x_max = (etd->capabilities[1] - i) *
+					etd->samples[1] / 2;
+				*y_max = (etd->capabilities[2] - i) *
+					etd->samples[2] / 2;
 			} else if (etd->fw_version == 0x040216) {
 				*x_max = 819;
 				*y_max = 405;