Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473216

Re: [PATCH] mfd: arizona: Add sensible return value to some error paths

From Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mfd: arizona: Add sensible return value to some error paths
Date 2016-08-31 11:20 +0200
Message-ID <sc9QB-xQ-5@gated-at.bofh.it> (permalink)
References <s5gWS-8h2-17@gated-at.bofh.it> <sc9nz-8Q-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mfd: arizona: Add sensible return value to some error  paths Lee Jones <lee.jones@linaro.org> - 2016-08-31 10:50 +0200
  Re: [PATCH] mfd: arizona: Add sensible return value to some error  paths Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2016-08-31 11:20 +0200

csiph-web