From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Mark Brown <broonie@kernel.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Anton Vorontsov <anton@enomsg.org>,
David Woodhouse <dwmw2@infradead.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Pawel Moll <pawel.moll@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Rob Landley <rob@landley.net>,
linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH v2 1/5] mfd: max14577: Add max14577 MFD driver core
Date: Thu, 21 Nov 2013 11:31:49 +0100 [thread overview]
Message-ID: <1385029909.26695.5.camel@AMDC1943> (raw)
In-Reply-To: <20131120153103.GG2674@sirena.org.uk>
In-Reply-To: <20131120153103.GG2674@sirena.org.uk>
On Wed, 2013-11-20 at 15:31 +0000, Mark Brown wrote:
> On Wed, Nov 20, 2013 at 03:12:08PM +0100, Krzysztof Kozlowski wrote:
>
> > +static irqreturn_t max14577_irq_thread(int irq, void *data)
> > +{
> > + struct max14577 *max14577 = data;
> > + u8 irq_reg[MAX14577_IRQ_REGS_NUM] = {0};
> > + u8 tmp_irq_reg[MAX14577_IRQ_REGS_NUM] = {};
> > + int i, cur_irq;
> > +
> > + max14577_bulk_read(max14577->regmap, MAX14577_REG_INT1,
> > + &tmp_irq_reg[MAX14577_IRQ_INT1],
> > + MAX14577_IRQ_REGS_NUM);
>
> All this interrupt handling looks like a straight copy of the regmap
> code?
You are right, I will convert it to regmap_irq_chip.
> > +int max14577_irq_resume(struct max14577 *max14577)
> > +{
> > + int ret = 0;
> > +
> > + if (max14577->irq && max14577->irq_domain)
> > + ret = max14577_irq_thread(0, max14577);
>
> Are you sure that this is not going to race nastily if the interrupt
> goes off during resume?
I believe this code came from max77693. At least it looks very similar.
Also it seems it was a fast workaround for interrupt occurring during
device resume (before I2C bus resume). Handling this interrupt failed
and interrupt registers were not cleared.
This code is not needed now, especially after using regmap IRQ handling.
>
> > +
> > + return ret >= 0 ? 0 : ret;
>
> This check isn't a triumph of legibility.
OK.
>
> > + if (IS_ERR_OR_NULL(pdata)) {
> > + dev_err(&i2c->dev, "No platform data found: %ld\n",
> > + PTR_ERR(pdata));
> > + return -EINVAL;
> > + }
>
> Why IS_ERR_OR_NULL().
Right, it should be just check for null.
>
> > +#else
> > +#define max14577_suspend NULL
> > +#define max14577_resume NULL
> > +#endif /* CONFIG_PM */
>
> You don't need these since you use SIMPLE_DEV_PM_OPS().
OK.
>
> > +#else
> > +#define max14577_dt_match NULL
> > +#endif
>
> Similarly here.
OK.
Thanks for comments.
Best regards,
Krzysztof
next prev parent reply other threads:[~2013-11-21 10:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 14:12 [PATCH v2 0/5] mfd: max14577: Add max14577 MFD drivers Krzysztof Kozlowski
2013-11-20 14:12 ` [PATCH v2 1/5] mfd: max14577: Add max14577 MFD driver core Krzysztof Kozlowski
[not found] ` <1384956732-19526-2-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-20 15:31 ` Mark Brown
2013-11-21 10:31 ` Krzysztof Kozlowski [this message]
2013-11-21 10:34 ` Lee Jones
2013-11-21 11:43 ` Krzysztof Kozlowski
2013-11-21 12:20 ` Lee Jones
2013-11-21 13:34 ` Krzysztof Kozlowski
2013-11-20 14:12 ` [PATCH v2 2/5] extcon: max14577: Add extcon-max14577 driver to support MUIC device Krzysztof Kozlowski
2013-11-20 14:12 ` [PATCH v2 3/5] charger: max14577: Add charger support for Maxim 14577 Krzysztof Kozlowski
2013-11-20 14:12 ` [PATCH v2 4/5] regulator: max14577: Add regulator driver " Krzysztof Kozlowski
2013-11-20 15:35 ` Mark Brown
2013-11-20 17:54 ` Bartlomiej Zolnierkiewicz
2013-11-20 17:58 ` Bartlomiej Zolnierkiewicz
2013-11-21 14:27 ` Krzysztof Kozlowski
2013-11-20 14:12 ` [PATCH v2 5/5] mfd: max14577: Add device tree bindings document Krzysztof Kozlowski
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=1385029909.26695.5.camel@AMDC1943 \
--to=k.kozlowski@samsung.com \
--cc=anton@enomsg.org \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kyungmin.park@samsung.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=myungjoo.ham@samsung.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sameo@linux.intel.com \
--cc=swarren@wwwdotorg.org \
/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).