ASoC: fsi: Add check for clk_enable

[ Upstream commit 405afed8a728f23cfaa02f75bbc8bdd6b7322123 ]

As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: ab6f6d8521 ("ASoC: fsi: add master clock control functions")
Signed-off-by: Jiasheng Jiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Jiasheng Jiang 2022-03-02 14:28:44 +08:00 • committed by Greg Kroah-Hartman
commit 58e42ee4a0

View file

@ -816,14 +816,27 @@ static int fsi_clk_enable(struct device *dev,
return ret;
}
clk_enable(clock->xck);
clk_enable(clock->ick);
clk_enable(clock->div);
ret = clk_enable(clock->xck);
if (ret)
goto err;
ret = clk_enable(clock->ick);
if (ret)
goto disable_xck;
ret = clk_enable(clock->div);
if (ret)
goto disable_ick;
clock->count++;
}
return ret;
disable_ick:
clk_disable(clock->ick);
disable_xck:
clk_disable(clock->xck);
err:
return ret;
}
static int fsi_clk_disable(struct device *dev,