mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Mani, Rajmohan" <rajmohan.mani@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v4 1/3] mfd: Add new mfd device TPS68470
Date: Wed, 26 Jul 2017 09:23:04 +0100	[thread overview]
Message-ID: <20170726082304.7j4lbvsuyyu7owqy@dell> (raw)
In-Reply-To: <CAHp75VeGqWNyDO644V+mje4sWsODDhyxRJ8cQ-HDV_e1hAUP3g@mail.gmail.com>

On Tue, 25 Jul 2017, Andy Shevchenko wrote:

> On Tue, Jul 25, 2017 at 12:10 PM, Lee Jones <lee.jones@linaro.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;
> 
> ?

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

  reply	other threads:[~2017-07-26  8:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 23:20 [PATCH v4 0/3] TPS68470 PMIC drivers Rajmohan Mani
2017-07-19 23:20 ` [PATCH v4 1/3] mfd: Add new mfd device TPS68470 Rajmohan Mani
2017-07-20  9:03   ` Lee Jones
2017-07-21  0:57     ` Mani, Rajmohan
2017-07-25  9:10       ` Lee Jones
2017-07-25 10:29         ` Andy Shevchenko
2017-07-26  8:23           ` Lee Jones [this message]
2017-07-26 10:26             ` Andy Shevchenko
2017-07-28  0:30               ` Mani, Rajmohan
2017-07-28  9:16                 ` Andy Shevchenko
2017-07-28 23:48                   ` Mani, Rajmohan
2017-07-25 17:05         ` Mani, Rajmohan
2017-07-26  8:20           ` Lee Jones
2017-07-28 23:49             ` Mani, Rajmohan
2017-07-21 12:26     ` Mani, Rajmohan
2017-07-19 23:20 ` [PATCH v4 2/3] gpio: Add support for TPS68470 GPIOs Rajmohan Mani
2017-07-19 23:20 ` [PATCH v4 3/3] ACPI / PMIC: Add TI PMIC TPS68470 operation region driver Rajmohan Mani

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=20170726082304.7j4lbvsuyyu7owqy@dell \
    --to=lee.jones@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajmohan.mani@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=sakari.ailus@linux.intel.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

all inboxes | Powered by JetHome®