From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
Liam Girdwood <lgirdwood@gmail.com>,
Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH] ASoC: omap: Check regulator enable for DAC on Pandora
Date: Sat, 2 Mar 2013 16:02:06 +0100 [thread overview]
Message-ID: <5132146E.602@ti.com> (raw)
In-Reply-To: <1362210594-17633-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On 03/02/2013 08:49 AM, Mark Brown wrote:
> This will probably never fail but it's better style.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> sound/soc/omap/omap3pandora.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
> index 805512f..953483e 100644
> --- a/sound/soc/omap/omap3pandora.c
> +++ b/sound/soc/omap/omap3pandora.c
> @@ -85,7 +85,11 @@ static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
> * VCC power on/off and /PD pin high/low
> */
> if (SND_SOC_DAPM_EVENT_ON(event)) {
> - regulator_enable(omap3pandora_dac_reg);
> + ret = regulator_enable(omap3pandora_dac_reg);
> + if (ret != 0) {
The rest of this machine driver uses "if (ret < 0)" or "if (ret)". I would use:
+ if (ret) {
> + dev_err(w->dapm.dev, "Failed to power DAC: %d\n", ret);
> + return ret;
> + }
> mdelay(1);
> gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 1);
> } else {
>
Otherwise:
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
next prev parent reply other threads:[~2013-03-02 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-02 7:49 [PATCH] ASoC: omap: Check regulator enable for DAC on Pandora Mark Brown
2013-03-02 15:02 ` Peter Ujfalusi [this message]
2013-03-03 9:11 ` Jarkko Nikula
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=5132146E.602@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jarkko.nikula@bitmer.com \
--cc=lgirdwood@gmail.com \
--cc=linux-omap@vger.kernel.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