summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-12-14 05:08:22 +0300
committerMark Brown <broonie@kernel.org>2021-12-20 15:47:01 +0300
commit5ea4e76b73cd6f2cf29b02a57040c1a11fa8c3f0 (patch)
treee03bfacddd7027ae8c58f7ea7234d7a224766af8
parentc50384d7e331aceeb4072bf363d5235eddda65bf (diff)
downloadlinux-5ea4e76b73cd6f2cf29b02a57040c1a11fa8c3f0.tar.xz
ASoC: codecs: ak4118: Use dev_err_probe() helper
Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20211214020843.2225831-2-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/ak4118.c18
1 files 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,