[alsa-devel] [PATCH 2/2] ASoC: rsnd: suppress rsnd_dai_call() debug message
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Feb 13 03:09:14 CET 2018
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
rsnd_dai_call() is using dev_dbg(), but its message is sometimes
blocks nessesary other messages. If RSND_DEBUG_NO_DAI_CALL was
defined it will be suppressed by this patch.
Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx at renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx at renesas.com>
---
sound/soc/sh/rcar/core.c | 11 ++++++++++-
sound/soc/sh/rcar/rsnd.h | 10 ++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index b400766..b53e915 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -93,6 +93,15 @@
* [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
*
*/
+
+/*
+ * you can enable below define if you don't need
+ * DAI status debug message when debugging
+ * see rsnd_dbg_dai_call()
+ *
+ * #define RSND_DEBUG_NO_DAI_CALL 1
+ */
+
#include <linux/pm_runtime.h>
#include "rsnd.h"
@@ -468,7 +477,7 @@ static int rsnd_status_update(u32 *status,
__rsnd_mod_shift_##fn, \
__rsnd_mod_add_##fn, \
__rsnd_mod_call_##fn); \
- dev_dbg(dev, "%s[%d]\t0x%08x %s\n", \
+ rsnd_dbg_dai_call(dev, "%s[%d]\t0x%08x %s\n", \
rsnd_mod_name(mod), rsnd_mod_id(mod), *status, \
(func_call && (mod)->ops->fn) ? #fn : ""); \
if (func_call && (mod)->ops->fn) \
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 5241ea7..172c8d6 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -798,4 +798,14 @@ unsigned int rsnd_src_get_rate(struct rsnd_priv *priv,
if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \
dev_dbg(dev, param)
+/*
+ * If you don't need rsnd_dai_call debug message,
+ * define RSND_DEBUG_NO_DAI_CALL as 1 on top of core.c
+ *
+ * #define RSND_DEBUG_NO_DAI_CALL 1
+ */
+#define rsnd_dbg_dai_call(dev, param...) \
+ if (!IS_BUILTIN(RSND_DEBUG_NO_DAI_CALL)) \
+ dev_dbg(dev, param)
+
#endif
--
1.9.1
More information about the Alsa-devel
mailing list