drivers/usb/typec/mux/ptn36502.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/typec/mux/ptn36502.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/mux/ptn36502.c b/drivers/usb/typec/mux/ptn36502.c
index 129d9d24b932..b1a2977b974c 100644
--- a/drivers/usb/typec/mux/ptn36502.c
+++ b/drivers/usb/typec/mux/ptn36502.c
@@ -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;
}
--
2.51.1
On Mon, Oct 20, 2025 at 06:00:06PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/mux/ptn36502.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/mux/ptn36502.c b/drivers/usb/typec/mux/ptn36502.c
> index 129d9d24b932..b1a2977b974c 100644
> --- a/drivers/usb/typec/mux/ptn36502.c
> +++ b/drivers/usb/typec/mux/ptn36502.c
> @@ -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;
> }
>
> --
> 2.51.1
--
heikki
© 2016 - 2026 Red Hat, Inc.