[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeGqWNyDO644V+mje4sWsODDhyxRJ8cQ-HDV_e1hAUP3g@mail.gmail.com>
Date: Tue, 25 Jul 2017 13:29:15 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Lee Jones <lee.jones@...aro.org>
Cc: "Mani, Rajmohan" <rajmohan.mani@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
"sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>
Subject: Re: [PATCH v4 1/3] mfd: Add new mfd device TPS68470
On Tue, Jul 25, 2017 at 12:10 PM, Lee Jones <lee.jones@...aro.org> 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;
?
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)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists