Skip to content

Commit

Permalink
power: supply: mp2629_charger: use platform_get_irq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergey Shtylyov authored and Sebastian Reichel committed Feb 1, 2022
1 parent 441d38c commit 2b7950c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/power/supply/mp2629_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b7950c

Please sign in to comment.