From: Thierry Reding <thierry.reding@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Beniamino Galvani <b.galvani@gmail.com>,
linux-pwm@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pwm: spear: fix check on pwmchip_add() return value
Date: Wed, 7 May 2014 10:24:11 +0200 [thread overview]
Message-ID: <20140507082410.GC6362@ulmo> (raw)
In-Reply-To: <CAOh2x=mWqa=p2d1kRjf0_37DiioJZOJm3Ewv2xpMrNjPy69rvA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]
On Wed, May 07, 2014 at 11:37:25AM +0530, Viresh Kumar wrote:
> On Tue, May 6, 2014 at 2:59 AM, Beniamino Galvani <b.galvani@gmail.com> wrote:
> > pwmchip_add() returns zero on success and a negative value on error,
> > so the condition of the check must be inverted.
> >
> > Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
> > ---
> > drivers/pwm/pwm-spear.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
> > index cb2d4f0..945556d 100644
> > --- a/drivers/pwm/pwm-spear.c
> > +++ b/drivers/pwm/pwm-spear.c
> > @@ -222,7 +222,7 @@ static int spear_pwm_probe(struct platform_device *pdev)
> > }
> >
> > ret = pwmchip_add(&pc->chip);
> > - if (!ret) {
> > + if (ret < 0) {
> > clk_unprepare(pc->clk);
> > dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
> > }
So the current code would run clk_unprepare() on success, but not on
failure. Does that cause any harm? Is the device still usable after
this? I'm asking because I'm not sure if this is linux-next material
or should be a fix for 3.15 (and possibly backported to stable).
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-07 8:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 21:29 [PATCH] pwm: spear: fix check on pwmchip_add() return value Beniamino Galvani
2014-05-07 6:07 ` Viresh Kumar
2014-05-07 8:24 ` Thierry Reding [this message]
2014-05-07 8:32 ` Viresh Kumar
2014-05-07 8:49 ` Thierry Reding
2014-05-07 8:53 ` Viresh Kumar
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=20140507082410.GC6362@ulmo \
--to=thierry.reding@gmail.com \
--cc=b.galvani@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.