Re: [PATCH 01/17] ASoC: soc-dai: add soc_dai_err()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/22/20 6:13 PM, Kuninori Morimoto wrote:

From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

At soc-dai.c, it is good idea to indicate error function and
its component name if there was error.
This patch adds soc_dai_err() for it.

the code below adds soc_dai_ret(), is this a typo?


Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
  sound/soc/soc-dai.c | 155 +++++++++++++++++++++++++++-----------------
  1 file changed, 96 insertions(+), 59 deletions(-)

diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 31c41559034b..d591b3bd8b99 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -9,6 +9,24 @@
  #include <sound/soc.h>
  #include <sound/soc-dai.h>
+#define soc_dai_ret(dai, ret) _soc_dai_ret(dai, __func__, ret)
+static inline int _soc_dai_ret(struct snd_soc_dai *dai,
+			       const char *func, int ret)
+{
+	switch (ret) {
+	case -EPROBE_DEFER:
+	case -ENOTSUPP:
+	case 0:
+		break;
+	default:
+		dev_err(dai->dev,
+			"ASoC: error at %s on %s: %d\n",
+			func, dai->name, ret);
+	}
+
+	return ret;
+}
+




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux