Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Anatol Pomozov <anatol.pomozov@gmail.com>, alsa-devel@alsa-project.org
Cc: kwestfie@codeaurora.org, broonie@kernel.org
Subject: Re: [PATCH 1/3] ASoC: max98357a: Make 'sdmode-gpios' dts property optional
Date: Sun, 12 Jul 2015 12:31:01 +0200	[thread overview]
Message-ID: <55A241E5.1030807@metafoo.de> (raw)
In-Reply-To: <1436684202-16461-1-git-send-email-anatol.pomozov@gmail.com>

On 07/12/2015 08:56 AM, Anatol Pomozov wrote:
[...]
> @@ -61,7 +64,7 @@ static int max98357a_codec_probe(struct snd_soc_codec *codec)
>   	struct gpio_desc *sdmode;
>
>   	sdmode = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW);
> -	if (IS_ERR(sdmode)) {
> +	if (IS_ERR(sdmode) && (PTR_ERR(sdmode) != -ENOENT)) {

There is is devm_gpiod_get_optional() exactly for this use case. It will 
return NULL if no GPIO is specified.

>   		dev_err(codec->dev, "%s() unable to get sdmode GPIO: %ld\n",
>   				__func__, PTR_ERR(sdmode));
>   		return PTR_ERR(sdmode);
>

  parent reply	other threads:[~2015-07-12 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12  6:56 [PATCH 1/3] ASoC: max98357a: Make 'sdmode-gpios' dts property optional Anatol Pomozov
2015-07-12  6:56 ` [PATCH 2/3] ASoC: max98357a: Specify digital input as a dapm widget Anatol Pomozov
2015-07-12 10:33   ` Lars-Peter Clausen
2015-07-12 15:15     ` Anatol Pomozov
2015-07-12  6:56 ` [PATCH 3/3] ASoC: max98357a: Do not print error message on gpio get Anatol Pomozov
2015-07-12 10:31 ` Lars-Peter Clausen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-12 15:14 [PATCH 1/3] ASoC: max98357a: Make 'sdmode-gpios' dts property optional Anatol Pomozov
2015-07-13 22:04 ` Kenneth Westfield

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=55A241E5.1030807@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=anatol.pomozov@gmail.com \
    --cc=broonie@kernel.org \
    --cc=kwestfie@codeaurora.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