Skip to contentSkip to conversation

Input: edt-ft5x06 - add a missing condition

PATCH Superseded Dan Carpenter 3 participants 5 messages Apr 2, 2014 – Apr 3, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: edt-ft5x06 - add a missing condition

The if condition was accidentally deleted here so we return every time instead of returning on error.

Fixes fd335ab04b3f ('Input: edt-ft5x06 - add support for M09 firmware version')
drivers/input/touchscreen/edt-ft5x06.c +4 -3
index 75b666b..9d0b324 100644
@@ -291,9 +291,10 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata,
 		wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f;
 		wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40;
 
-		error = edt_ft5x06_ts_readwrite(tsdata->client,
-						2, wrbuf, 2, rdbuf);
-		return error;
+		error = edt_ft5x06_ts_readwrite(tsdata->client,	2, wrbuf, 2,
+						rdbuf);
+		if (error)
+			return error;
 
 		if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) {
 			dev_err(&tsdata->client->dev,
#1 lore raw
Quoted 12 lines · Dan Carpenter

The if condition was accidentally deleted here so we return every time instead of returning on error.

Fixes fd335ab04b3f ('Input: edt-ft5x06 - add support for M09 firmware version')
drivers/input/touchscreen/edt-ft5x06.c +0 -0
index 75b666b..9d0b324 100644

drivers/input/touchscreen/edt-ft5x06.c static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, · line 294

Quoted 7 lines
drivers/input/touchscreen/edt-ft5x06.c +1 -3
@@ -291,9 +291,10 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata,
 		wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f;
 		wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40;
 
-		error = edt_ft5x06_ts_readwrite(tsdata->client,
-						2, wrbuf, 2, rdbuf);
-		return error;
+		error = edt_ft5x06_ts_readwrite(tsdata->client,	2, wrbuf, 2,
                                                                                 ^^^^^^

I think that 'tab' is not necessary between "client," and "2,". Others look good.

Best regards,
Jingoo Han

Quoted 6 lines
drivers/input/touchscreen/edt-ft5x06.c +3 -0
+						rdbuf);
+		if (error)
+			return error;
 
 		if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) {
 			dev_err(&tsdata->client->dev,
#2 lore raw

PATCH v2 1/1 Input: edt-ft5x06 - add a missing condition

The if condition was accidentally deleted here so we return every time instead of returning on error.

Fixes fd335ab04b3f ('Input: edt-ft5x06 - add support for M09 firmware version')

---
v2: removed a stray tab character

drivers/input/touchscreen/edt-ft5x06.c +4 -3
index 75b666b..9d0b324 100644
@@ -291,9 +291,10 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata,
 		wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f;
 		wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40;
 
-		error = edt_ft5x06_ts_readwrite(tsdata->client,
-						2, wrbuf, 2, rdbuf);
-		return error;
+		error = edt_ft5x06_ts_readwrite(tsdata->client, 2, wrbuf, 2,
+						rdbuf);
+		if (error)
+			return error;
 
 		if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) {
 			dev_err(&tsdata->client->dev,
Reviewed-by on v2 1/1
#3 lore raw
Quoted 6 lines · Dan Carpenter

The if condition was accidentally deleted here so we return every time instead of returning on error.

Fixes fd335ab04b3f ('Input: edt-ft5x06 - add support for M09 firmware version')

Best regards,
Jingoo Han

Quoted 21 lines

---
v2: removed a stray tab character

drivers/input/touchscreen/edt-ft5x06.c +4 -3
index 75b666b..9d0b324 100644
@@ -291,9 +291,10 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata,
 		wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f;
 		wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40;
 
-		error = edt_ft5x06_ts_readwrite(tsdata->client,
-						2, wrbuf, 2, rdbuf);
-		return error;
+		error = edt_ft5x06_ts_readwrite(tsdata->client, 2, wrbuf, 2,
+						rdbuf);
+		if (error)
+			return error;
 
 		if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) {
 			dev_err(&tsdata->client->dev,
Acked-by on v2 1/1
#4 lore raw
In reply to Dan Carpenter

Hi,

Quoted 17 lines · Dan Carpenter

The if condition was accidentally deleted here so we return every time instead of returning on error.

Fixes fd335ab04b3f ('Input: edt-ft5x06 - add support for M09 firmware version')

---
v2: removed a stray tab character

drivers/input/touchscreen/edt-ft5x06.c +0 -0
index 75b666b..9d0b324 100644
@@ -291,9 +291,10 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata,
 		wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f;
 		wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40;
 

drivers/input/touchscreen/edt-ft5x06.c static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, · line 300

Quoted 10 lines
drivers/input/touchscreen/edt-ft5x06.c +4 -3
-		error = edt_ft5x06_ts_readwrite(tsdata->client,
-						2, wrbuf, 2, rdbuf);
-		return error;
+		error = edt_ft5x06_ts_readwrite(tsdata->client, 2, wrbuf, 2,
+						rdbuf);
+		if (error)
+			return error;
 
 		if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) {
 			dev_err(&tsdata->client->dev,

Lothar Waßmann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | [email protected]
___________________________________________________________