Re: [PATCH v8 4/6] power: supply: Add support for mps mp2629 battery charger

From: Andy Shevchenko
Date: Mon Apr 13 2020 - 16:11:12 EST


On Mon, Apr 13, 2020 at 8:37 PM Saravanan Sekar <sravanhome@xxxxxxxxx> wrote:
>
> The mp2629 provides switching-mode battery charge management for
> single-cell Li-ion or Li-polymer battery. Driver supports the
> access/control input source and battery charging parameters.

...

> +static int mp2629_charger_probe(struct platform_device *pdev)
> +{

> + irq = platform_get_irq(to_platform_device(pdev->dev.parent), 0);

Why not to use temporary variable dev?

This should be platform_get_irq_optional().

> + if (irq) {
> + ret = devm_request_irq(dev, irq, mp2629_irq_handler,
> + IRQF_TRIGGER_RISING, "mp2629-charger",
> + charger);
> + if (ret) {
> + dev_err(dev, "failed to request gpio IRQ\n");
> + goto iio_fail;
> + }
> + }

> +}

--
With Best Regards,
Andy Shevchenko