From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>, <jikos@kernel.org>,
<benjamin.tissoires@redhat.com>, <jkosina@suse.cz>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<linux-input@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH 2/3] ASoC: tpa6130a2: Use gpio_is_valid()
Date: Fri, 27 Apr 2018 12:33:43 +0300 [thread overview]
Message-ID: <2ed0acde-c4da-0e1d-a62a-433c858e14a6@ti.com> (raw)
In-Reply-To: <195792a282b569037357ca17e4baad19893f0609.1524819052.git.arvind.yadav.cs@gmail.com>
On 2018-04-27 11:56, Arvind Yadav wrote:
> Replace the manual validity checks for the GPIO with the
> gpio_is_valid().
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> sound/soc/codecs/tpa6130a2.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
> index 616cd4b..18f32b9 100644
> --- a/sound/soc/codecs/tpa6130a2.c
> +++ b/sound/soc/codecs/tpa6130a2.c
> @@ -62,7 +62,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
> return ret;
> }
> /* Power on */
> - if (data->power_gpio >= 0)
> + if (gpio_is_valid(data->power_gpio))
> gpio_set_value(data->power_gpio, 1);
>
> /* Sync registers */
> @@ -72,7 +72,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
> dev_err(data->dev,
> "Failed to sync registers: %d\n", ret);
> regcache_cache_only(data->regmap, true);
> - if (data->power_gpio >= 0)
> + if (gpio_is_valid(data->power_gpio))
> gpio_set_value(data->power_gpio, 0);
> ret2 = regulator_disable(data->supply);
> if (ret2 != 0)
> @@ -89,7 +89,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
> regcache_cache_only(data->regmap, true);
>
> /* Power off */
> - if (data->power_gpio >= 0)
> + if (gpio_is_valid(data->power_gpio))
> gpio_set_value(data->power_gpio, 0);
>
> ret = regulator_disable(data->supply);
> @@ -259,7 +259,7 @@ static int tpa6130a2_probe(struct i2c_client *client,
>
> data->id = id->driver_data;
>
> - if (data->power_gpio >= 0) {
> + if (gpio_is_valid(data->power_gpio)) {
> ret = devm_gpio_request(dev, data->power_gpio,
> "tpa6130a2 enable");
> if (ret < 0) {
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2018-04-27 9:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 8:56 [PATCH 0/3] ASoC: " Arvind Yadav
2018-04-27 8:56 ` [PATCH 1/3] ASoC: tlv320dac33: " Arvind Yadav
2018-04-27 9:33 ` [alsa-devel] " Peter Ujfalusi
2018-04-27 8:56 ` [PATCH 2/3] ASoC: tpa6130a2: " Arvind Yadav
2018-04-27 9:33 ` Peter Ujfalusi [this message]
2018-04-27 8:56 ` [PATCH 3/3] ASoC: samsung: " Arvind Yadav
[not found] ` <CGME20180427093444epcas2p185dbba85e2d37bde95ce3929a57c1f01@epcas2p1.samsung.com>
2018-04-27 9:34 ` Sylwester Nawrocki
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=2ed0acde-c4da-0e1d-a62a-433c858e14a6@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®