Skip to contentSkip to conversation

usb: typec-mux: ptn36502: Omit a variable reassignment in ptn36502_probe()

PATCH In review Markus Elfring 2 participants 2 messages Oct 20, 2025 – Oct 21, 2025

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

PATCH 1/1 usb: typec-mux: ptn36502: Omit a variable reassignment in ptn36502_probe()

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 17:50:12 +0200

An error code was assigned to a variable and checked accordingly. This value was passed to a dev_err_probe() call in an if branch. This function is documented in the way that the same value is returned. Thus delete a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

---
 drivers/usb/typec/mux/ptn36502.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/mux/ptn36502.c +1 -1
index 129d9d24b932..b1a2977b974c 100644
@@ -339,7 +339,7 @@ static int ptn36502_probe(struct i2c_client *client)
 
 	ret = regulator_enable(ptn->vdd18_supply);
 	if (ret) {
-		ret = dev_err_probe(dev, ret, "Failed to enable vdd18\n");
+		dev_err_probe(dev, ret, "Failed to enable vdd18\n");
 		goto err_mux_put;
 	}
 
Signature · 1 line
2.51.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 17:50:12 +0200

An error code was assigned to a variable and checked accordingly. This value was passed to a dev_err_probe() call in an if branch. This function is documented in the way that the same value is returned. Thus delete a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

Quoted 19 lines
---
 drivers/usb/typec/mux/ptn36502.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/mux/ptn36502.c +1 -1
index 129d9d24b932..b1a2977b974c 100644
@@ -339,7 +339,7 @@ static int ptn36502_probe(struct i2c_client *client)
 
 	ret = regulator_enable(ptn->vdd18_supply);
 	if (ret) {
-		ret = dev_err_probe(dev, ret, "Failed to enable vdd18\n");
+		dev_err_probe(dev, ret, "Failed to enable vdd18\n");
 		goto err_mux_put;
 	}
 
Signature · 1 line
2.51.1
Signature · 1 line
heikki