From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ASoC: OMAP: ams-delta: drop .set_bias_level callback
Date: Mon, 26 Dec 2011 11:03:49 +0000 [thread overview]
Message-ID: <20111226110348.GB8722@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1324681944-19067-5-git-send-email-jkrzyszt@tis.icnet.pl>
On Sat, Dec 24, 2011 at 12:12:24AM +0100, Janusz Krzysztofik wrote:
> +struct regulator_consumer_data {
> + struct mutex lock;
> + struct regulator *regulator;
> + bool enabled;
> +};
> +
> +static int regulator_toggle(struct regulator_consumer_data *consumer,
> + bool enable)
> +{
> + int err = 0;
> +
> + if (!consumer->regulator)
> + return -ENODEV;
> +
> + mutex_lock(&consumer->lock);
> + if (IS_ERR(consumer->regulator)) {
> + err = PTR_ERR(consumer->regulator);
> + } else if (enable) {
> + if (!consumer->enabled) {
> + err = regulator_enable(consumer->regulator);
> + consumer->enabled = true;
> + }
> + } else {
> + if (consumer->enabled) {
> + err = regulator_disable(consumer->regulator);
> + consumer->enabled = false;
> + }
> + }
> + mutex_unlock(&consumer->lock);
> +
> + return err;
> +}
> +
Why's this code not been dropped and what is it for?
next prev parent reply other threads:[~2011-12-26 11:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-23 23:12 [PATCH 0/4] Amstrad Delta: access MODEM_RESET GPIO pin over a regulator Janusz Krzysztofik
2011-12-23 23:12 ` [PATCH 1/4] ARM: OMAP1: ams-delta: set up regulator over modem reset GPIO pin Janusz Krzysztofik
2011-12-23 23:12 ` [PATCH 2/4] ASoC: cx20442: add bias control over a platform provided regulator Janusz Krzysztofik
2011-12-26 11:02 ` Mark Brown
2011-12-26 12:18 ` [alsa-devel] " Janusz Krzysztofik
2011-12-27 14:16 ` Janusz Krzysztofik
2011-12-27 17:26 ` Mark Brown
2011-12-23 23:12 ` [PATCH 3/4] ARM: OMAP1: ams-delta: update the modem to use regulator API Janusz Krzysztofik
2011-12-23 23:12 ` [PATCH 4/4] ASoC: OMAP: ams-delta: drop .set_bias_level callback Janusz Krzysztofik
2011-12-26 11:03 ` Mark Brown [this message]
2011-12-26 12:30 ` Janusz Krzysztofik
2011-12-26 17:23 ` Mark Brown
2011-12-26 20:43 ` Janusz Krzysztofik
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=20111226110348.GB8722@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).