ASoC: rsnd: adg: check return value for rsnd_adg_get_clkin/out()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 1 Jun 2021 23:44:09 +0000 (08:44 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 3 Jun 2021 12:56:41 +0000 (13:56 +0100)
commitd668a5e2409b2ff9291493b70c961ecbe883bfb2
treebac964fd52a6cba78c981c2dc0fb89aedc57306a
parentcb2f97d89f383dafa822bce66f0c3514dfb135b8
ASoC: rsnd: adg: check return value for rsnd_adg_get_clkin/out()

Current rsnd_adg_get_clkin/out() are void function,
thus adg->clk/clkout[i] might be NULL.

But, for_each_rsnd_clk/clkout() macros are assuming
all clks are non NULL.

Because of this mismatch, code can be complex and/or buggy.
These functions return error by this patch,
and make sure all clks are non NULL.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmx5i20m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/adg.c