]> Git Repo - linux.git/commitdiff
ASoC: soc-dai: return proper error for get_sdw_stream()
authorSrinivas Kandagatla <[email protected]>
Mon, 16 Mar 2020 15:11:10 +0000 (15:11 +0000)
committerMark Brown <[email protected]>
Mon, 16 Mar 2020 18:07:41 +0000 (18:07 +0000)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
include/sound/soc-dai.h

index 7f70db149b812a2ed4c06b23a857d74d79b92e26..78bac995db151fdac6dcb9243c299b11ad0e21ba 100644 (file)
@@ -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
This page took 0.088416 seconds and 4 git commands to generate.