Re: [PATCH] rtc: pcf2127: add support for accessing internal static RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20/05/2018 20:40:01+0200, Uwe Kleine-König wrote:
> Hello Alexandre,
> 
> On Sun, May 20, 2018 at 08:05:20PM +0200, Alexandre Belloni wrote:
> > On 20/05/2018 15:37:23+0200, Uwe Kleine-König wrote:
> > > @@ -200,8 +242,21 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
> > >  
> > >  	pcf2127->rtc = devm_rtc_device_register(dev, name, &pcf2127_rtc_ops,
> > >  						THIS_MODULE);
> > > +	if (IS_ERR(pcf2127->rtc))
> > > +		return PTR_ERR(pcf2127->rtc);
> > > +
> > > +	if (has_nvmem) {
> > > +		struct nvmem_config nvmem_cfg = {
> > > +			.priv = pcf2127,
> > > +			.reg_read = pcf2127_nvmem_read,
> > > +			.reg_write = pcf2127_nvmem_write,
> > > +			.size = 512,
> > > +		};
> > > +
> > > +		ret = rtc_nvmem_register(pcf2127->rtc, &nvmem_cfg);
> > > +	}
> > >  
> > > -	return PTR_ERR_OR_ZERO(pcf2127->rtc);
> > > +	return ret;
> > 
> > You must not return an error here once devm_rtc_device_register has
> > succeeded.
> 
> Why? Sounds like something that should be fixed.
> 

This is the explanation:
http://patchwork.ozlabs.org/patch/324263/


-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux