Skip to contentSkip to conversation

power: supply: Remove unnecessary print function dev_err()

PATCH In review Yang Li 2 participants 2 messages May 4, 2022 – Jun 9, 2022 Power supply

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 power: supply: Remove unnecessary print function dev_err()

The print function dev_err() is redundant because
platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/power/supply/goldfish_battery.c:225:2-9: line 225 is redundant because platform_get_irq() already prints an error

---
 drivers/power/supply/goldfish_battery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/power/supply/goldfish_battery.c +1 -3
index bf1754355c9f..a58d713d75ce 100644
@@ -221,10 +221,8 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 	}
 
 	data->irq = platform_get_irq(pdev, 0);
-	if (data->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed\n");
+	if (data->irq < 0)
 		return -ENODEV;
-	}
 
 	ret = devm_request_irq(&pdev->dev, data->irq,
 			       goldfish_battery_interrupt,
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw

Hi,

Quoted 10 lines · Yang Li

The print function dev_err() is redundant because
platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/power/supply/goldfish_battery.c:225:2-9: line 225 is redundant because platform_get_irq() already prints an error

---

Thanks, queued.

-- Sebastian

Quoted 22 lines
 drivers/power/supply/goldfish_battery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/power/supply/goldfish_battery.c +1 -3
index bf1754355c9f..a58d713d75ce 100644
@@ -221,10 +221,8 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 	}
 
 	data->irq = platform_get_irq(pdev, 0);
-	if (data->irq < 0) {
-		dev_err(&pdev->dev, "platform_get_irq failed\n");
+	if (data->irq < 0)
 		return -ENODEV;
-	}
 
 	ret = devm_request_irq(&pdev->dev, data->irq,
 			       goldfish_battery_interrupt,
Signature · 1 line
2.20.1.7.g153144c