diff mbox series

[-next,2/3] ASoC: cs42l42: Switch to use dev_err_probe() helper

Message ID 20220914133355.3779364-2-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 28a3fb26e83e013c929a2e1185743ece7e8173ff
Headers show
Series [-next,1/3] ASoC: bcm2835-i2s: Switch to use dev_err_probe() helper | expand

Commit Message

Yang Yingliang Sept. 14, 2022, 1:33 p.m. UTC
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/soc/codecs/cs42l42.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 7d8f1b161a65..205babc4268b 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -2263,11 +2263,9 @@  static int cs42l42_i2c_probe(struct i2c_client *i2c_client)
 					   NULL, cs42l42_irq_thread,
 					   IRQF_ONESHOT | IRQF_TRIGGER_LOW,
 					   "cs42l42", cs42l42);
-		if (ret == -EPROBE_DEFER) {
-			goto err_disable_noirq;
-		} else if (ret != 0) {
-			dev_err(&i2c_client->dev,
-				"Failed to request IRQ: %d\n", ret);
+		if (ret) {
+			dev_err_probe(&i2c_client->dev, ret,
+				      "Failed to request IRQ\n");
 			goto err_disable_noirq;
 		}
 	}