From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Pawel Moll <pawel.moll@arm.com>
Cc: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v2 1/2] mtd: maps: physmap: Add VPP regulator control
Date: Mon, 23 Jul 2012 19:32:31 +0100 [thread overview]
Message-ID: <20120723183230.GA12438@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1343067861.19880.30.camel@hornet>
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
On Mon, Jul 23, 2012 at 07:24:21PM +0100, Pawel Moll wrote:
> On Mon, 2012-07-23 at 18:46 +0100, Mark Brown wrote:
> > > + info->vpp_regulator = devm_regulator_get(&dev->dev, "vpp");
> > > + if (IS_ERR(info->vpp_regulator))
> > > + info->vpp_regulator = NULL;
> > No, this is very bad karma. You shouldn't just silently ignore the
> > error here, if we didn't get the supply it's probably important and
> > otherwise why bother checking the error at all?
> The reason is simple - to make the regulator completely optional. That's
> also why I check the existence of "vpp-supply" property in the OF
> version.
Yes, I know what you think you're doing here but the fact remains that
you're just guessing about why you got an error, perhaps it's due to
there not being anything there but perhaps it's something important.
The thing that's particularly bad here is that your change will just
silently ignore the error which is far from awesome, at the very least
it ought to complain (though I don't think that's a good idea).
It shouldn't be that hard to find the in-tree users...
> > At a bare minimum you should be passing back -EPROBE_DEFER if you get
> > that.
> Which is, if I'm not mistaken, exactly what is returned when no supply
> is defined by the board. Which gets us to the starting point. As I said
> - if this is deemed unacceptable, I'll simply forget about this patch.
Well, in the DT case it'll probably start returning -ENODEV soon if
there's no supply binding set up (which would get you back to your
current case), given that you're from ARM probably that's covering all
the cases you're especially interested in. Otherwise we just can't tell
why we didn't find the regulator.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-07-23 18:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 13:21 [PATCH v2 0/2] Regulator control of physmap-ed chip's VPP Pawel Moll
2012-07-18 13:22 ` [PATCH v2 1/2] mtd: maps: physmap: Add VPP regulator control Pawel Moll
2012-07-23 17:46 ` Mark Brown
2012-07-23 18:24 ` Pawel Moll
2012-07-23 18:32 ` Mark Brown [this message]
2012-07-23 18:42 ` Pawel Moll
2012-07-23 18:45 ` Mark Brown
2012-07-23 19:04 ` Pawel Moll
2012-07-23 19:12 ` Mark Brown
2012-07-18 13:22 ` [PATCH 2/2] mtd: maps: physmap_of: " Pawel Moll
2012-07-18 16:02 ` [PATCH v2 0/2] Regulator control of physmap-ed chip's VPP Artem Bityutskiy
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=20120723183230.GA12438@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=Artem.Bityutskiy@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=pawel.moll@arm.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;
as well as URLs for NNTP newsgroup(s).