From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>, alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org
Subject: Re: [PATCH 1/2] ASoC: rt5645: fix error handling for gpio detection
Date: Wed, 1 Feb 2017 23:41:38 -0600 [thread overview]
Message-ID: <484655e6-a394-7701-cd70-2b7023e79499@linux.intel.com> (raw)
In-Reply-To: <c41f5795-4b53-48d5-5a46-b2a579f3b931@sakamocchi.jp>
>> if (IS_ERR(rt5645->gpiod_hp_det)) {
>> - dev_err(&i2c->dev, "failed to initialize gpiod\n");
>> - return PTR_ERR(rt5645->gpiod_hp_det);
>> + dev_info(&i2c->dev, "failed to initialize gpiod\n");
>> + ret = PTR_ERR(rt5645->gpiod_hp_det);
>> + /*
>> + * Continue if optional gpiod is missing, bail for all other
>> + * errors, including -EPROBE_DEFER
>> + */
>> + if (ret != -ENOENT)
>> + return ret;
>> }
>>
>> for (i = 0; i < ARRAY_SIZE(rt5645->supplies); i++)
>
> (sound/soc/codecs/rt5645.c)
> rt5645_i2c_probe()
> (drivers/gpio/devres.c)
> ->devm_gpiod_get_optional()
> ->devm_gpiod_get_index_optional()
>
> As long as seeing current implementation of
> 'devm_gpiod_get_index_optional()', this function never returns ENOENT.
> In this case, it returns NULL.
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpio/devres.c#n185
>
Thanks for pointing this out, I didn't see it and naively thought that
everyone followed the same conventions. Oh well. I'll respin a v2.
next prev parent reply other threads:[~2017-02-02 5:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 18:27 [PATCH 0/2] Baytrail/Cherrytrail audio fixes - take2 Pierre-Louis Bossart
2017-02-01 18:27 ` [PATCH 1/2] ASoC: rt5645: fix error handling for gpio detection Pierre-Louis Bossart
2017-02-02 2:40 ` Takashi Sakamoto
2017-02-02 5:41 ` Pierre-Louis Bossart [this message]
2017-02-02 11:06 ` Applied "ASoC: rt5645: fix error handling for gpio detection" to the asoc tree Mark Brown
2017-02-01 18:27 ` [PATCH 2/2] ASoC: cht-bsw-rt5645: fix unused variable compiler warning Pierre-Louis Bossart
2017-02-02 11:06 ` Applied "ASoC: cht-bsw-rt5645: fix unused variable compiler warning" to the asoc tree 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=484655e6-a394-7701-cd70-2b7023e79499@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=o-takashi@sakamocchi.jp \
--cc=tiwai@suse.de \
/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).