Skip to contentSkip to conversation

Input: elants_i2c - return real value of elants_i2c_initialize()

PATCH In review Johnny.Chuang 2 participants 5 messages Aug 28, 2019 – Sep 4, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Input: elants_i2c - return real value of elants_i2c_initialize()

The return value of elants_i2c_initialize() was always 0. It maybe register input device when initialize fail.

---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/input/touchscreen/elants_i2c.c
index d4ad24e..9c9816f 100644

drivers/input/touchscreen/elants_i2c.c +1 -1
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data *ts)
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
Signature · 1 line
2.7.4
#2 lore raw

Hi Johnny,

Quoted 2 lines · Johnny.Chuang

The return value of elants_i2c_initialize() was always 0. It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and then we will not be able to initiate firmware flash flow so we can attempt to recover the device.

If you want to try you can change the ts->iap_mode before trying to register input device, but then you need to be very careful about registering and unregistering it later, after flashing or re-flashing firmware.

Quoted 23 lines
---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +1 -1
index d4ad24e..9c9816f 100644
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data *ts)
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
Signature · 1 line
2.7.4

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

Hi Dmitry,

Thanks for your explanation.
If I want to abandon this patch, what's step I need to do?

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:[email protected]]
Sent: Friday, August 30, 2019 2:30 AM
To: Johnny.Chuang
Cc: [email protected]; [email protected]; STRD2-蔡惠嬋; STRD2-陳崇明經理; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()

Hi Johnny,

Quoted 2 lines · Johnny.Chuang

The return value of elants_i2c_initialize() was always 0. It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and then we will not be able to initiate firmware flash flow so we can attempt to recover the device.

If you want to try you can change the ts->iap_mode before trying to register input device, but then you need to be very careful about registering and unregistering it later, after flashing or re-flashing firmware.

drivers/input/touchscreen/elants_i2c.c static int elants_i2c_initialize(struct elants_data

Quoted 12 lines
---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +0 -0
index d4ad24e..9c9816f 100644
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data

*ts)

Quoted 11 lines
drivers/input/touchscreen/elants_i2c.c +1 -2
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
--

2.7.4

Thanks.

Signature · 1 line
Dmitry
#4 lore raw
Quoted 4 lines · Johnny.Chuang

Hi Dmitry,

Thanks for your explanation.
If I want to abandon this patch, what's step I need to do?

Absolutely nothing ;) Consider it dropped.

Quoted 56 lines

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:[email protected]]
Sent: Friday, August 30, 2019 2:30 AM
To: Johnny.Chuang
Cc: [email protected]; [email protected]; STRD2-蔡惠嬋; STRD2-陳崇明經理; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()

Hi Johnny,

Quoted 2 lines · Johnny.Chuang

The return value of elants_i2c_initialize() was always 0. It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and then we will not be able to initiate firmware flash flow so we can attempt to recover the device.

If you want to try you can change the ts->iap_mode before trying to register input device, but then you need to be very careful about registering and unregistering it later, after flashing or re-flashing firmware.

drivers/input/touchscreen/elants_i2c.c static int elants_i2c_initialize(struct elants_data

Quoted 12 lines
---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +0 -0
index d4ad24e..9c9816f 100644
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data

*ts)

Quoted 11 lines
drivers/input/touchscreen/elants_i2c.c +1 -2
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
--

2.7.4

Thanks.

Signature · 1 line
Dmitry
Signature · 1 line
Dmitry
#5 lore raw

Hi Dmitry,

Got it, let it dropped.

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:[email protected]]
Sent: Tuesday, September 03, 2019 11:55 PM
To: Johnny.Chuang
Cc: [email protected]; [email protected]; 'STRD2-蔡惠嬋'; 'STRD2-陳崇明經理'; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()

Quoted 4 lines · Johnny.Chuang

Hi Dmitry,

Thanks for your explanation.
If I want to abandon this patch, what's step I need to do?

Absolutely nothing ;) Consider it dropped.

Quoted 56 lines

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:[email protected]]
Sent: Friday, August 30, 2019 2:30 AM
To: Johnny.Chuang
Cc: [email protected]; [email protected]; STRD2-蔡惠嬋; STRD2-陳崇明經理; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()

Hi Johnny,

Quoted 2 lines · Johnny.Chuang

The return value of elants_i2c_initialize() was always 0. It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and then we will not be able to initiate firmware flash flow so we can attempt to recover the device.

If you want to try you can change the ts->iap_mode before trying to register input device, but then you need to be very careful about registering and unregistering it later, after flashing or re-flashing firmware.

drivers/input/touchscreen/elants_i2c.c static int elants_i2c_initialize(struct elants_data

Quoted 12 lines
---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +0 -0
index d4ad24e..9c9816f 100644
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data

*ts)

Quoted 11 lines
drivers/input/touchscreen/elants_i2c.c +1 -2
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
--

2.7.4

Thanks.

Signature · 1 line
Dmitry
Signature · 1 line
Dmitry