ASoC: Change handling of unimplemented set_bclk_ratio
authorMartin Povišer <povik+lin@cutebit.org>
Thu, 18 Aug 2022 16:53:36 +0000 (18:53 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 19 Aug 2022 12:19:59 +0000 (13:19 +0100)
If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
still be okay with the ratio, just does not care to register a handler.

No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
the return value, but -ENOSUPP disables an error print from within the
common soc_dai_ret return filter. With the new behavior a machine
driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
which may care about the ratio, some of which may not.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220818165336.76403-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dai.c

index d530e8c..49752af 100644 (file)
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll);
  */
 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
 {
-       int ret = -EINVAL;
+       int ret = -ENOTSUPP;
 
        if (dai->driver->ops &&
            dai->driver->ops->set_bclk_ratio)