linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: saravanan sekar <sravanhome@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v8 4/6] power: supply: Add support for mps mp2629 battery charger
Date: Mon, 13 Apr 2020 22:48:47 +0200	[thread overview]
Message-ID: <20200413204847.ni7dsrn5tslrorqn@earth.universe> (raw)
In-Reply-To: <6cfab0a6-c3eb-bd9b-6572-b49e3205524f@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-04-13 20:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 17:36 [PATCH v8 0/6] Add battery charger driver support for MP2629 Saravanan Sekar
2020-04-13 17:36 ` [PATCH v8 1/6] dt-bindings: mfd: add document bindings for mp2629 Saravanan Sekar
2020-04-13 17:36 ` [PATCH v8 2/6] mfd: mp2629: Add support for mps battery charger Saravanan Sekar
2020-04-13 17:36 ` [PATCH v8 3/6] iio: adc: mp2629: Add support for mp2629 ADC driver Saravanan Sekar
2020-04-13 17:36 ` [PATCH v8 4/6] power: supply: Add support for mps mp2629 battery charger Saravanan Sekar
2020-04-13 20:10   ` Andy Shevchenko
2020-04-13 20:28     ` saravanan sekar
2020-04-13 20:48       ` Sebastian Reichel [this message]
2020-04-14  9:05         ` Andy Shevchenko
2020-04-14 10:49           ` Sebastian Reichel
2020-04-13 17:36 ` [PATCH v8 5/6] power: supply: mp2629: Add impedance compenstation config Saravanan Sekar
2020-04-13 17:36 ` [PATCH v8 6/6] MAINTAINERS: Add entry for mp2629 Battery Charger driver Saravanan Sekar
2020-04-13 20:01 ` [PATCH v8 0/6] Add battery charger driver support for MP2629 Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200413204847.ni7dsrn5tslrorqn@earth.universe \
    --to=sebastian.reichel@collabora.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=sravanhome@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).