diff mbox

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

Message ID 87y4ihvqym.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 72413c107e81386a7da438bcf888ee2af5d3b72f
Headers show

Commit Message

Kuninori Morimoto July 15, 2015, 7:10 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

enabling to use same method for exception case is useful.

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

Patch

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)