From: Mark Brown <broonie@opensource•wolfsonmicro.com>
To: Robert Marklund <robert.marklund@stericsson•com>
Cc: netdev@vger•kernel.org,
Steve Glendinning <steve.glendinning@smsc•com>,
Mathieu Poirer <mathieu.poirier@linaro•org>
Subject: Re: [PATCH] smsc911x: Add regulator support
Date: Mon, 17 Oct 2011 11:52:56 +0100 [thread overview]
Message-ID: <20111017105256.GG5448@sirena.org.uk> (raw)
In-Reply-To: <1318834597-3479-1-git-send-email-robert.marklund@stericsson.com>
On Mon, Oct 17, 2011 at 08:56:37AM +0200, Robert Marklund wrote:
> + /* Request regulator for vddvario */
> + if (request && !pdata->regulator_vddvario) {
> + pdata->regulator_vddvario = regulator_get(&pdev->dev,
> + "vddvario");
> + if (IS_ERR(pdata->regulator_vddvario)) {
> + netdev_warn(ndev,
> + "%s: Failed to get regulator '%s'\n",
> + __func__, "vddvario");
> + pdata->regulator_vddvario = NULL;
> + }
No, this is broken - look at how other devices use the regulator API.
The driver should just request and use the regulators unconditionally
and let the stubbing and mapping facilities the API has deal with
ensuring that they always succeed.
As a side note the use of "pdata" as a name for the driver internal data
is really not helpful, pdata is traditionally the platform data passed
in by the machine (which would be even more broken).
next prev parent reply other threads:[~2011-10-17 10:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 6:56 [PATCH] smsc911x: Add regulator support Robert Marklund
2011-10-17 10:52 ` Mark Brown [this message]
2011-10-17 11:30 ` Robert MARKLUND
2011-10-17 12:36 ` Mark Brown
2011-10-17 14:13 ` Robert MARKLUND
2011-10-17 14:33 ` Mark Brown
2011-10-17 15:28 ` Robert MARKLUND
2011-10-17 15:38 ` Mark Brown
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=20111017105256.GG5448@sirena.org.uk \
--to=broonie@opensource$(echo .)wolfsonmicro.com \
--cc=mathieu.poirier@linaro$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=robert.marklund@stericsson$(echo .)com \
--cc=steve.glendinning@smsc$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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