lkml.org 
[lkml]   [2020]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 4/6] power: supply: Add support for mps mp2629 battery charger
Hi,

On Mon, Apr 13, 2020 at 10:28:19PM +0200, saravanan sekar wrote:
> Hi Andy,
>
> On 13/04/20 10:10 pm, Andy Shevchenko wrote:
> > On Mon, Apr 13, 2020 at 8:37 PM Saravanan Sekar <sravanhome@gmail.com> 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().
>
> Platform_get_irq in turn calls platform_get_irq_optional. It was suggested
> by Lee and is it mandatory to change it?

platform_get_irq is fine.

> > > + if (irq) {

But this must be

if (irq > 0)

or you will also try to continue with error codes.

> > > + 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;
> > > + }
> > > + }
> > > +}

-- Sebastian
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-04-13 22:49    [W:0.089 / U:24.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site