From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH 01/22] ASoC: codecs: ak4118: Use dev_err_probe() helper
Date: Tue, 14 Dec 2021 11:08:22 +0900 [thread overview]
Message-ID: <20211214020843.2225831-2-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20211214020843.2225831-1-kuninori.morimoto.gx@renesas.com>
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Use the dev_err_probe() helper, instead of open-coding the same
operation.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/codecs/ak4118.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c
index e0a6451851e8..2e6bafd2a821 100644
--- a/sound/soc/codecs/ak4118.c
+++ b/sound/soc/codecs/ak4118.c
@@ -374,20 +374,14 @@ static int ak4118_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, ak4118);
ak4118->reset = devm_gpiod_get(&i2c->dev, "reset", GPIOD_OUT_HIGH);
- if (IS_ERR(ak4118->reset)) {
- ret = PTR_ERR(ak4118->reset);
- if (ret != -EPROBE_DEFER)
- dev_err(&i2c->dev, "Failed to get reset: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(ak4118->reset))
+ return dev_err_probe(&i2c->dev, PTR_ERR(ak4118->reset),
+ "Failed to get reset\n");
ak4118->irq = devm_gpiod_get(&i2c->dev, "irq", GPIOD_IN);
- if (IS_ERR(ak4118->irq)) {
- ret = PTR_ERR(ak4118->irq);
- if (ret != -EPROBE_DEFER)
- dev_err(&i2c->dev, "Failed to get IRQ: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(ak4118->irq))
+ return dev_err_probe(&i2c->dev, PTR_ERR(ak4118->irq),
+ "Failed to get IRQ\n");
ret = devm_request_threaded_irq(&i2c->dev, gpiod_to_irq(ak4118->irq),
NULL, ak4118_irq_handler,
--
2.25.1
next prev parent reply other threads:[~2021-12-14 2:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 2:08 [PATCH 00/22] ASoC: Use dev_err_probe() helper Kuninori Morimoto
2021-12-14 2:08 ` Kuninori Morimoto [this message]
2021-12-14 2:08 ` [PATCH 02/22] ASoC: codecs: es7241: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 03/22] ASoC: codecs: max9759: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 04/22] ASoC: codecs: max9860: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 05/22] ASoC: codecs: pcm3168a: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 06/22] ASoC: codecs: sgtl5000: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 07/22] ASoC: codecs: simple-amplifier: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 08/22] ASoC: codecs: simple-mux: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 09/22] ASoC: codecs: ssm2305: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 10/22] ASoC: codecs: tlv320aic31xx: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 11/22] ASoC: ateml: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 12/22] ASoC: ti: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 13/22] ASoC: fsl: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 14/22] ASoC: generic: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 15/22] ASoC: img: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 16/22] ASoC: meson: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 17/22] ASoC: mxs: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 18/22] ASoC: qcom: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 19/22] ASoC: rockchip: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 20/22] ASoC: samsung: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 21/22] ASoC: stm: " Kuninori Morimoto
2021-12-14 2:08 ` [PATCH 22/22] ASoC: sunxi: " Kuninori Morimoto
2021-12-21 2:50 ` [PATCH 00/22] ASoC: " 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=20211214020843.2225831-2-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@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;
as well as URLs for NNTP newsgroup(s).