[PATCH] media: i2c: imx290: Omit a variable reassignment in imx290_probe()

Markus Elfring posted 1 patch 3 months, 2 weeks ago
drivers/media/i2c/imx290.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] media: i2c: imx290: Omit a variable reassignment in imx290_probe()
Posted by Markus Elfring 3 months, 2 weeks ago
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 20 Oct 2025 14:10:20 +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/media/i2c/imx290.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
index 21cbc81cb2ed..9623a9c21c9d 100644
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -1633,7 +1633,7 @@ static int imx290_probe(struct i2c_client *client)
 	 */
 	ret = imx290_stop_streaming(imx290);
 	if (ret) {
-		ret = dev_err_probe(dev, ret, "Could not initialize device\n");
+		dev_err_probe(dev, ret, "Could not initialize device\n");
 		goto err_pm;
 	}
 
-- 
2.51.1