[alsa-devel] [PATCH 10/35] ASoC: rsnd: rsnd_mod_id() return -1 if mod was NULL

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Jul 15 09:10:43 CEST 2015


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

enabling to use same method for exception case is useful.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym at renesas.com>
---
 sound/soc/sh/rcar/rsnd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 9ecd151..46eb4da 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -316,7 +316,7 @@ struct rsnd_mod {
 
 #define rsnd_mod_to_priv(mod) ((mod)->priv)
 #define rsnd_mod_to_dma(mod) (&(mod)->dma)
-#define rsnd_mod_id(mod) ((mod)->id)
+#define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1)
 #define rsnd_mod_hw_start(mod)	clk_enable((mod)->clk)
 #define rsnd_mod_hw_stop(mod)	clk_disable((mod)->clk)
 
-- 
1.9.1



More information about the Alsa-devel mailing list