Skip to contentSkip to conversation

Input: elants_i2c - delete some dead code

PATCH Applied Dan Carpenter 4 participants 4 messages Nov 23, 2022 – Nov 29, 2022

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

PATCH 1/1 Input: elants_i2c - delete some dead code

We shuffled the error handling around so this condition is dead code now. The "error" variable is always zero.

---
No Fixes tag because this does not fix a bug but if we were to assign a tag it would be:

Fixes a85fbd649844 ("Input: elants_i2c - properly handle the reset GPIO when power is off")
 drivers/input/touchscreen/elants_i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/input/touchscreen/elants_i2c.c +0 -2
index e1308e179dd6..af1dc43e988c 100644
@@ -1353,8 +1353,6 @@ static int elants_i2c_power_on(struct elants_data *ts)
 	udelay(ELAN_POWERON_DELAY_USEC);
 
 	gpiod_set_value_cansleep(ts->reset_gpio, 0);
-	if (error)
-		return error;
 
 	msleep(ELAN_RESET_DELAY_MSEC);
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

We shuffled the error handling around so this condition is dead code now. The "error" variable is always zero.

Quoted 24 lines

---
No Fixes tag because this does not fix a bug but if we were to assign a tag it would be:

Fixes a85fbd649844 ("Input: elants_i2c - properly handle the reset GPIO when power is off")
 drivers/input/touchscreen/elants_i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/input/touchscreen/elants_i2c.c +0 -2
index e1308e179dd6..af1dc43e988c 100644
@@ -1353,8 +1353,6 @@ static int elants_i2c_power_on(struct elants_data *ts)
 	udelay(ELAN_POWERON_DELAY_USEC);
 
 	gpiod_set_value_cansleep(ts->reset_gpio, 0);
-	if (error)
-		return error;
 
 	msleep(ELAN_RESET_DELAY_MSEC);
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Hi,

Quoted 19 lines · Dan Carpenter

We shuffled the error handling around so this condition is dead code now. The "error" variable is always zero.

---
No Fixes tag because this does not fix a bug but if we were to assign a tag it would be:

Fixes a85fbd649844 ("Input: elants_i2c - properly handle the reset GPIO when power is off")
 drivers/input/touchscreen/elants_i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/input/touchscreen/elants_i2c.c +0 -0
index e1308e179dd6..af1dc43e988c 100644

drivers/input/touchscreen/elants_i2c.c static int elants_i2c_power_on(struct elants_data *ts) · line 1357

Quoted 5 lines
drivers/input/touchscreen/elants_i2c.c +0 -2
@@ -1353,8 +1353,6 @@ static int elants_i2c_power_on(struct elants_data *ts)
        udelay(ELAN_POWERON_DELAY_USEC);
 
        gpiod_set_value_cansleep(ts->reset_gpio, 0);
-       if (error)
-               return error;