diff mbox series

power: supply: mp2629_charger: use platform_get_irq()

Message ID 618c2445-724f-8be5-47a6-c8739489f56f@omp.ru (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series power: supply: mp2629_charger: use platform_get_irq() | expand

Commit Message

Sergey Shtylyov Jan. 27, 2022, 7:44 p.m. UTC
Calling platform_get_irq_optional() doesn't make sense if you then bail out
on any error it returns.  Switch to calling platform_get_irq() instead and
remove dev_err() call as platform_get_irq() already curses loudly on error.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'for-next' branch of Sebastian Reichel's
'linux-power-supply.git' repo.

 drivers/power/supply/mp2629_charger.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

Index: linux-power-supply/drivers/power/supply/mp2629_charger.c
===================================================================
--- linux-power-supply.orig/drivers/power/supply/mp2629_charger.c
+++ linux-power-supply/drivers/power/supply/mp2629_charger.c
@@ -580,11 +580,9 @@  static int mp2629_charger_probe(struct p
 	charger->dev = dev;
 	platform_set_drvdata(pdev, charger);
 
-	irq = platform_get_irq_optional(to_platform_device(dev->parent), 0);
-	if (irq < 0) {
-		dev_err(dev, "get irq fail: %d\n", irq);
+	irq = platform_get_irq(to_platform_device(dev->parent), 0);
+	if (irq < 0)
 		return irq;
-	}
 
 	for (i = 0; i < MP2629_MAX_FIELD; i++) {
 		charger->regmap_fields[i] = devm_regmap_field_alloc(dev,