From: Philipp Zabel <p.zabel@pengutronix.de>
To: Bernhard Walle <bernhard@bwalle.de>
Cc: lgirdwood@gmail.com, broonie@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: ltc3589: Make IRQ optional
Date: Wed, 10 Feb 2016 10:44:19 +0100 [thread overview]
Message-ID: <1455097459.3597.3.camel@pengutronix.de> (raw)
In-Reply-To: <1455048884-1143-1-git-send-email-bernhard@bwalle.de>
Am Dienstag, den 09.02.2016, 21:14 +0100 schrieb Bernhard Walle:
> It's perfectly valid to use the LTC3589 without an interrupt pin
> connected to it. Currently, the driver probing fails when client->irq
> is 0 (which means "no interrupt"). Don't register the interrupt
> handler in that case but successfully finish the device probing instead.
>
> Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
I suggest these small changes:
[...]
> @@ -520,12 +520,14 @@ static int ltc3589_probe(struct i2c_client *client,
> }
> }
>
> - ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,
> - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> - client->name, ltc3589);
> - if (ret) {
> - dev_err(dev, "Failed to request IRQ: %d\n", ret);
> - return ret;
> + if (client->irq != 0) {
How about using
if (client->irq) {
here ...
> + ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,
... and reflowing this ...
> + IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> + client->name, ltc3589);
> + if (ret) {
> + dev_err(dev, "Failed to request IRQ %d: %d\n", client->irq, ret);
... and this long line.
regards
Philipp
next prev parent reply other threads:[~2016-02-10 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 20:14 Bernhard Walle
2016-02-10 9:44 ` Philipp Zabel [this message]
2016-02-10 20:36 ` Bernhard Walle
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=1455097459.3597.3.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=bernhard@bwalle.de \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®