From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Andrey Panin <pazke@centrinvest.ru>
Cc: Richard Purdie <rpurdie@rpsys.net>,
linux-kernel@vger.kernel.org,
Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 2/2] leds: Add WM831x status LED driver
Date: Mon, 7 Sep 2009 10:07:57 +0100 [thread overview]
Message-ID: <20090907090757.GB21558@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20090907072507.GA19269@centrinvest.ru>
On Mon, Sep 07, 2009 at 11:25:07AM +0400, Andrey Panin wrote:
> On 248, 09 05, 2009 at 02:09:21PM +0100, Mark Brown wrote:
> > + if (res == NULL) {
> > + dev_err(&pdev->dev, "No I/O resource\n");
> > + ret = -EINVAL;
> > + goto err;
> Why not return -EINVAL right here ?
For consistency with the rest of the function which uses this style for
unwinding (though I see there's a cut'n'pasted return early on which
it'd be nice to clean up).
> > +err_led:
> > + led_classdev_unregister(&drvdata->cdev);
> This line looks useless and possibly unsafe, led device was not registered.
True.
> Also this part of code can be removed if you move next line up.
I'd prefer to keep the unwinding at the end, it makes the initialisation
much easier to modify.
next prev parent reply other threads:[~2009-09-07 9:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 13:09 [PATCH 1/2] backlight: Add WM831x backlight driver Mark Brown
2009-09-05 13:09 ` [PATCH 2/2] leds: Add WM831x status LED driver Mark Brown
2009-09-07 7:25 ` Andrey Panin
2009-09-07 9:07 ` Mark Brown [this message]
2009-09-07 13:22 ` Pavel Machek
2009-09-07 13:51 ` Richard Purdie
2009-09-09 9:12 ` Samuel Ortiz
2009-09-09 9:38 ` Mark Brown
2009-09-09 9:52 ` Samuel Ortiz
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=20090907090757.GB21558@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pazke@centrinvest.ru \
--cc=rpurdie@rpsys.net \
--cc=sameo@linux.intel.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
all inboxes | Powered by JetHome®