Skip to contentSkip to conversation

regulator: tps65219: Fix erorr codes in probe()

PATCH Superseded Dan Carpenter 2 participants 3 messages May 7, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: tps65219: Fix erorr codes in probe()

There is a copy and paste error and we accidentally use "PTR_ERR(rdev)" instead of "error". The "rdev" pointer is valid at this point so the existing code returns a positive value instead of instead of a negative error code.

Fixes 38c9f98db20a ("regulator: tps65219: Add support for TPS65215 Regulator IRQs")
---
 drivers/regulator/tps65219-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/tps65219-regulator.c +2 -2
index b16b300d7f45..f5cd8e33e518 100644
@@ -454,7 +454,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
 						  irq_type->irq_name,
 						  &irq_data[i]);
 		if (error)
-			return dev_err_probe(tps->dev, PTR_ERR(rdev),
+			return dev_err_probe(tps->dev, error,
 					     "Failed to request %s IRQ %d: %d\n",
 					     irq_type->irq_name, irq, error);
 	}
@@ -477,7 +477,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
 						  irq_type->irq_name,
 						  &irq_data[i]);
 		if (error)
-			return dev_err_probe(tps->dev, PTR_ERR(rdev),
+			return dev_err_probe(tps->dev, error,
 					     "Failed to request %s IRQ %d: %d\n",
 					     irq_type->irq_name, irq, error);
 	}
Signature · 1 line
2.47.2
#1 lore raw

Le 07/05/2025 à 14:59, Dan Carpenter a écrit :

Quoted 10 lines

There is a copy and paste error and we accidentally use "PTR_ERR(rdev)" instead of "error". The "rdev" pointer is valid at this point so the existing code returns a positive value instead of instead of a negative error code.

Fixes 38c9f98db20a ("regulator: tps65219: Add support for TPS65215 Regulator IRQs")
---
  drivers/regulator/tps65219-regulator.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Hi,

drivers/regulator/tps65219-regulator.c static int tps65219_regulator_probe(struct platform_device *pdev) · line 459

Quoted 13 lines
drivers/regulator/tps65219-regulator.c +1 -1
index b16b300d7f45..f5cd8e33e518 100644
@@ -454,7 +454,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
  						  irq_type->irq_name,
  						  &irq_data[i]);
  		if (error)
-			return dev_err_probe(tps->dev, PTR_ERR(rdev),
+			return dev_err_probe(tps->dev, error,
  					     "Failed to request %s IRQ %d: %d\n",
  					     irq_type->irq_name, irq, error);

and error can also be removed in the message as well, with the corresponding %d.

drivers/regulator/tps65219-regulator.c static int tps65219_regulator_probe(struct platform_device *pdev) · line 482

Quoted 9 lines
drivers/regulator/tps65219-regulator.c +1 -1
  	}
@@ -477,7 +477,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
  						  irq_type->irq_name,
  						  &irq_data[i]);
  		if (error)
-			return dev_err_probe(tps->dev, PTR_ERR(rdev),
+			return dev_err_probe(tps->dev, error,
  					     "Failed to request %s IRQ %d: %d\n",
  					     irq_type->irq_name, irq, error);

Same.

Quoted 1 line
drivers/regulator/tps65219-regulator.c +0 -0
  	}
#2 lore raw
Quoted 15 lines · Christophe JAILLET

Le 07/05/2025 à 14:59, Dan Carpenter a écrit :

Quoted 10 lines

There is a copy and paste error and we accidentally use "PTR_ERR(rdev)" instead of "error". The "rdev" pointer is valid at this point so the existing code returns a positive value instead of instead of a negative error code.

Fixes 38c9f98db20a ("regulator: tps65219: Add support for TPS65215 Regulator IRQs")
---
  drivers/regulator/tps65219-regulator.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Hi,

Quoted 1 line
Quoted 16 lines

drivers/regulator/tps65219-regulator.c static int tps65219_regulator_probe(struct platform_device *pdev) · line 459

Quoted 12 lines
drivers/regulator/tps65219-regulator.c +1 -1
index b16b300d7f45..f5cd8e33e518 100644
@@ -454,7 +454,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
  						  irq_type->irq_name,
  						  &irq_data[i]);
  		if (error)
-			return dev_err_probe(tps->dev, PTR_ERR(rdev),
+			return dev_err_probe(tps->dev, error,
  					     "Failed to request %s IRQ %d: %d\n",
  					     irq_type->irq_name, irq, error);

and error can also be removed in the message as well, with the corresponding %d.

Good point. Also I spelled "error" wrong in the subject.

regards,
dan carpenter