power: supply: mp2629_charger: use platform_get_irq()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Thu, 27 Jan 2022 19:44:25 +0000 (22:44 +0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 1 Feb 2022 09:32:35 +0000 (10:32 +0100)
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>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/mp2629_charger.c

index bdf924b73e478fcc1c030880a2d26823f28b099c..bf9c27b463a80d96186150b4a07592fd2ec10324 100644 (file)
@@ -580,11 +580,9 @@ static int mp2629_charger_probe(struct platform_device *pdev)
        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,