summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2020-03-16 16:11:10 +0100
committerMark Brown <broonie@kernel.org>2020-03-16 19:07:41 +0100
commit308811a327c38364fff7752d3009160632f5dd5e (patch)
tree7dde13155ed7ff9b019f09e02041ed9cdcda1544
parentMerge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/bro... (diff)
downloadlinux-308811a327c38364fff7752d3009160632f5dd5e.tar.xz
linux-308811a327c38364fff7752d3009160632f5dd5e.zip
ASoC: soc-dai: return proper error for get_sdw_stream()
snd_soc_dai_get_sdw_stream() returns null if dai does not support this callback, this is no very useful for the caller to differentiate if this is an error or unsupported call for the dai. return -ENOTSUPP in cases where this callback is not supported. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200316151110.2580-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-dai.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 7f70db149b81..78bac995db15 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -433,7 +433,7 @@ static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai,
* This routine only retrieves that was previously configured
* with snd_soc_dai_get_sdw_stream()
*
- * Returns pointer to stream or NULL;
+ * Returns pointer to stream or -ENOTSUPP if callback is not supported;
*/
static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai,
int direction)
@@ -441,7 +441,7 @@ static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai,
if (dai->driver->ops->get_sdw_stream)
return dai->driver->ops->get_sdw_stream(dai, direction);
else
- return NULL;
+ return ERR_PTR(-ENOTSUPP);
}
#endif