Skip to contentSkip to conversation

usb: typec: tcpci_maxim: remove redundant assignment

PATCH In review angkery 3 participants 3 messages Jan 24, 2021 – Jan 25, 2021

Subsystems (2)
lore
Share & tools
lore

angkery

author
#0 lore raw

PATCH v3 1/2 usb: typec: tcpci_maxim: remove redundant assignment

From: Junlin Yang <[email protected]>

PTR_ERR(chip->tcpci) has been used as a return value, it is not necessary to assign it to ret, so remove it.

---
v3:remove the newline modification.

 drivers/usb/typec/tcpm/tcpci_maxim.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/typec/tcpm/tcpci_maxim.c +0 -1
index 3192663..7f54f51a 100644
@@ -461,7 +461,6 @@ static int max_tcpci_probe(struct i2c_client *client, const struct i2c_device_id
 	chip->tcpci = tcpci_register_port(chip->dev, &chip->data);
 	if (IS_ERR(chip->tcpci)) {
 		dev_err(&client->dev, "TCPCI port registration failed");
-		ret = PTR_ERR(chip->tcpci);
 		return PTR_ERR(chip->tcpci);
 	}
 	chip->port = tcpci_get_tcpm_port(chip->tcpci);
Signature · 1 line
1.9.1
Reviewed-by on v3 1/2
#1 lore raw
Quoted 6 lines · angkery

From: Junlin Yang <[email protected]>

PTR_ERR(chip->tcpci) has been used as a return value, it is not necessary to assign it to ret, so remove it.

Quoted 21 lines

---
v3:remove the newline modification.

 drivers/usb/typec/tcpm/tcpci_maxim.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/typec/tcpm/tcpci_maxim.c +0 -1
index 3192663..7f54f51a 100644
@@ -461,7 +461,6 @@ static int max_tcpci_probe(struct i2c_client *client, const struct i2c_device_id
 	chip->tcpci = tcpci_register_port(chip->dev, &chip->data);
 	if (IS_ERR(chip->tcpci)) {
 		dev_err(&client->dev, "TCPCI port registration failed");
-		ret = PTR_ERR(chip->tcpci);
 		return PTR_ERR(chip->tcpci);
 	}
 	chip->port = tcpci_get_tcpm_port(chip->tcpci);
Signature · 1 line
1.9.1
maintainer Reviewed-by on v3 1/2
#2 lore raw
In reply to angkery
Quoted 6 lines · angkery

From: Junlin Yang <[email protected]>

PTR_ERR(chip->tcpci) has been used as a return value, it is not necessary to assign it to ret, so remove it.

Quoted 20 lines

---
v3:remove the newline modification.

 drivers/usb/typec/tcpm/tcpci_maxim.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/typec/tcpm/tcpci_maxim.c +0 -1
index 3192663..7f54f51a 100644
@@ -461,7 +461,6 @@ static int max_tcpci_probe(struct i2c_client *client, const struct i2c_device_id
 	chip->tcpci = tcpci_register_port(chip->dev, &chip->data);
 	if (IS_ERR(chip->tcpci)) {
 		dev_err(&client->dev, "TCPCI port registration failed");
-		ret = PTR_ERR(chip->tcpci);
 		return PTR_ERR(chip->tcpci);
 	}
 	chip->port = tcpci_get_tcpm_port(chip->tcpci);
Signature · 1 line
1.9.1

thanks,

Signature · 1 line
heikki