aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/cmd.c')
-rw-r--r--sound/soc/sh/rcar/cmd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/sh/rcar/cmd.c b/sound/soc/sh/rcar/cmd.c
index d879c010cf03..f1d4fb566892 100644
--- a/sound/soc/sh/rcar/cmd.c
+++ b/sound/soc/sh/rcar/cmd.c
@@ -31,7 +31,7 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
31 struct rsnd_mod *mix = rsnd_io_to_mod_mix(io); 31 struct rsnd_mod *mix = rsnd_io_to_mod_mix(io);
32 struct device *dev = rsnd_priv_to_dev(priv); 32 struct device *dev = rsnd_priv_to_dev(priv);
33 u32 data; 33 u32 data;
34 u32 path[] = { 34 static const u32 path[] = {
35 [1] = 1 << 0, 35 [1] = 1 << 0,
36 [5] = 1 << 8, 36 [5] = 1 << 8,
37 [6] = 1 << 12, 37 [6] = 1 << 12,
@@ -71,7 +71,7 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
71 } else { 71 } else {
72 struct rsnd_mod *src = rsnd_io_to_mod_src(io); 72 struct rsnd_mod *src = rsnd_io_to_mod_src(io);
73 73
74 u8 cmd_case[] = { 74 static const u8 cmd_case[] = {
75 [0] = 0x3, 75 [0] = 0x3,
76 [1] = 0x3, 76 [1] = 0x3,
77 [2] = 0x4, 77 [2] = 0x4,
@@ -82,6 +82,9 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
82 [9] = 0x2, 82 [9] = 0x2,
83 }; 83 };
84 84
85 if (unlikely(!src))
86 return -EIO;
87
85 data = path[rsnd_mod_id(src)] | 88 data = path[rsnd_mod_id(src)] |
86 cmd_case[rsnd_mod_id(src)] << 16; 89 cmd_case[rsnd_mod_id(src)] << 16;
87 } 90 }