From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <patches@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] mfd: arizona: Add sensible return value to some error paths
Date: Wed, 31 Aug 2016 10:13:05 +0100 [thread overview]
Message-ID: <20160831091305.GA21682@localhost.localdomain> (raw)
In-Reply-To: <20160831084327.GA27357@dell>
On Wed, Aug 31, 2016 at 09:43:27AM +0100, Lee Jones wrote:
> On Fri, 12 Aug 2016, Charles Keepax wrote:
>
> > There are some cases in arizona_dev_init, such as where we don't
> > recognise the chip ID, in which we head to the error path without
> > setting a sensible error code in ret. This would lead to the chip
> > silently failing probe, as it would still return 0. Fix this up by
> > adding appropriate sets of the return value.
> >
> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> > ---
> > drivers/mfd/arizona-core.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
> > index e4f97b3..34a2c26 100644
> > --- a/drivers/mfd/arizona-core.c
> > +++ b/drivers/mfd/arizona-core.c
> > @@ -1121,6 +1121,7 @@ int arizona_dev_init(struct arizona *arizona)
> > break;
> > default:
> > dev_err(arizona->dev, "Unknown device ID: %x\n", reg);
> > + ret = -EINVAL;
>
> -EINVAL doesn't seem right here.
>
> -ENODEV perhaps?
>
Yeah that does seem better, I will fire out another version.
Thanks,
Charles
prev parent reply other threads:[~2016-08-31 9:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 9:27 [PATCH] mfd: arizona: Add sensible return value to some error paths Charles Keepax
2016-08-31 8:43 ` Lee Jones
2016-08-31 9:13 ` Charles Keepax [this message]
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=20160831091305.GA21682@localhost.localdomain \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.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