diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-04-15 16:35:26 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-04-16 06:03:09 -0400 |
commit | 3f1a4d826751d9759fc95da4e47d08d2745e0055 (patch) | |
tree | 2939712327fe3fd9f40550f2a1ff0bc265883c6d | |
parent | 6967963d6d5cac40a091d075326f0e3ccb95c58a (diff) |
ASoC: Check we have DAI ops when calling via accessor functions
Also make sure we're checking for the right operation while we're here.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/soc-core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index dd28009f8969..92503927b0c6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2100,7 +2100,7 @@ EXPORT_SYMBOL_GPL(snd_soc_put_volsw_s8); | |||
2100 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | 2100 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, |
2101 | unsigned int freq, int dir) | 2101 | unsigned int freq, int dir) |
2102 | { | 2102 | { |
2103 | if (dai->ops->set_sysclk) | 2103 | if (dai->ops && dai->ops->set_sysclk) |
2104 | return dai->ops->set_sysclk(dai, clk_id, freq, dir); | 2104 | return dai->ops->set_sysclk(dai, clk_id, freq, dir); |
2105 | else | 2105 | else |
2106 | return -EINVAL; | 2106 | return -EINVAL; |
@@ -2120,7 +2120,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk); | |||
2120 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | 2120 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, |
2121 | int div_id, int div) | 2121 | int div_id, int div) |
2122 | { | 2122 | { |
2123 | if (dai->ops->set_clkdiv) | 2123 | if (dai->ops && dai->ops->set_clkdiv) |
2124 | return dai->ops->set_clkdiv(dai, div_id, div); | 2124 | return dai->ops->set_clkdiv(dai, div_id, div); |
2125 | else | 2125 | else |
2126 | return -EINVAL; | 2126 | return -EINVAL; |
@@ -2139,7 +2139,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_clkdiv); | |||
2139 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | 2139 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, |
2140 | int pll_id, unsigned int freq_in, unsigned int freq_out) | 2140 | int pll_id, unsigned int freq_in, unsigned int freq_out) |
2141 | { | 2141 | { |
2142 | if (dai->ops->set_pll) | 2142 | if (dai->ops && dai->ops->set_pll) |
2143 | return dai->ops->set_pll(dai, pll_id, freq_in, freq_out); | 2143 | return dai->ops->set_pll(dai, pll_id, freq_in, freq_out); |
2144 | else | 2144 | else |
2145 | return -EINVAL; | 2145 | return -EINVAL; |
@@ -2155,7 +2155,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll); | |||
2155 | */ | 2155 | */ |
2156 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | 2156 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
2157 | { | 2157 | { |
2158 | if (dai->ops->set_fmt) | 2158 | if (dai->ops && dai->ops->set_fmt) |
2159 | return dai->ops->set_fmt(dai, fmt); | 2159 | return dai->ops->set_fmt(dai, fmt); |
2160 | else | 2160 | else |
2161 | return -EINVAL; | 2161 | return -EINVAL; |
@@ -2174,7 +2174,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); | |||
2174 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 2174 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
2175 | unsigned int mask, int slots) | 2175 | unsigned int mask, int slots) |
2176 | { | 2176 | { |
2177 | if (dai->ops->set_sysclk) | 2177 | if (dai->ops && dai->ops->set_tdm_slot) |
2178 | return dai->ops->set_tdm_slot(dai, mask, slots); | 2178 | return dai->ops->set_tdm_slot(dai, mask, slots); |
2179 | else | 2179 | else |
2180 | return -EINVAL; | 2180 | return -EINVAL; |
@@ -2190,7 +2190,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); | |||
2190 | */ | 2190 | */ |
2191 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) | 2191 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) |
2192 | { | 2192 | { |
2193 | if (dai->ops->set_sysclk) | 2193 | if (dai->ops && dai->ops->set_tristate) |
2194 | return dai->ops->set_tristate(dai, tristate); | 2194 | return dai->ops->set_tristate(dai, tristate); |
2195 | else | 2195 | else |
2196 | return -EINVAL; | 2196 | return -EINVAL; |
@@ -2206,7 +2206,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate); | |||
2206 | */ | 2206 | */ |
2207 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) | 2207 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute) |
2208 | { | 2208 | { |
2209 | if (dai->ops->digital_mute) | 2209 | if (dai->ops && dai->ops->digital_mute) |
2210 | return dai->ops->digital_mute(dai, mute); | 2210 | return dai->ops->digital_mute(dai, mute); |
2211 | else | 2211 | else |
2212 | return -EINVAL; | 2212 | return -EINVAL; |