Skip to contentSkip to conversation

ASoC: sgtl5000: Do not print error on probe deferral

PATCH New Fabio Estevam 1 participant 2 messages Jan 17, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ASoC: sgtl5000: Do not print error on probe deferral

When the MCLK is not yet available when the codec is probed, probe deferral will happen and in this case we should not print an error message.

---
Changes since v1:
- Correcty mark this patch as 1/2

 sound/soc/codecs/sgtl5000.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/sgtl5000.c +4 -1
index f2bb4fe..633cdcf 100644
@@ -1332,10 +1332,13 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
 	sgtl5000->mclk = devm_clk_get(&client->dev, NULL);
 	if (IS_ERR(sgtl5000->mclk)) {
 		ret = PTR_ERR(sgtl5000->mclk);
-		dev_err(&client->dev, "Failed to get mclock: %d\n", ret);
 		/* Defer the probe to see if the clk will be provided later */
 		if (ret == -ENOENT)
 			ret = -EPROBE_DEFER;
+
+		if (ret != -EPROBE_DEFER)
+			dev_err(&client->dev, "Failed to get mclock: %d\n",
+				ret);
 		goto disable_regs;
 	}
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 2/2 ASoC: mxs-sgtl5000: Do not print error on probe deferral

Probe deferral may happen, so do not print an error message in this case.

---
Changes since v1:
- None

 sound/soc/mxs/mxs-sgtl5000.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/mxs/mxs-sgtl5000.c +3 -2
index b593f76..2b3f240 100644
@@ -163,8 +163,9 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret) {
-		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
-			ret);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
+				ret);
 		return ret;
 	}
 
Signature · 1 line
2.7.4