Re: [PATCH v4 1/3] mfd: Add new mfd device TPS68470

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

 



On Tue, 25 Jul 2017, Andy Shevchenko wrote:

> On Tue, Jul 25, 2017 at 12:10 PM, Lee Jones <lee.jones@xxxxxxxxxx> wrote:
> > On Fri, 21 Jul 2017, Mani, Rajmohan wrote:
> >> > On Wed, 19 Jul 2017, Rajmohan Mani wrote:
> 
> >> > > + /* Force software reset */
> >> > > + ret = regmap_write(regmap, TPS68470_REG_RESET,
> >> > TPS68470_REG_RESET_MASK);
> >> > > + if (ret < 0)
> >> >
> >> > Will 'if (!ret)' do?
> >> >
> >>
> >> We intend to check error conditions and bail out. So, if (ret < 0) works for this.
> >
> > Yes, 'if (!ret)' does that too.
> 
> Did you mean
> 
> if (ret)
>  return ret;
> 
> ?

Yes, I just noticed!

Apologies for the confusion.

> I briefly checked few ->read() and ->write() implementations and
> didn't find any evidence of positive numbers that can be returned.
> Documentation (kernel doc) doesn't shed a light on that. So, to me it
> sounds unspecified.
> 
> So, for now (until documentation will be fixed) I would rely on
> if (ret < 0)

It's not unspecified.  The regmap methods call into regcache_write(),
where the kerneldoc is clear.  Perhaps we can also change the regmap
kerneldoc headers too to match, which might lessen the disparity.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux