ASoC: rk817: Use devm_clk_get() in rk817_platform_probe
We need to call clk_put() to undo clk_get() in the error path.
Use devm_clk_get() to obtain a reference to the clock, It has
the benefit that clk_put() is no longer required.
Fixes: 0d6a04da9b
("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220404090753.17940-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
0b3d5d2e35
Коммит
8ba08d3a36
|
@ -489,7 +489,7 @@ static int rk817_platform_probe(struct platform_device *pdev)
|
|||
|
||||
rk817_codec_parse_dt_property(&pdev->dev, rk817_codec_data);
|
||||
|
||||
rk817_codec_data->mclk = clk_get(pdev->dev.parent, "mclk");
|
||||
rk817_codec_data->mclk = devm_clk_get(pdev->dev.parent, "mclk");
|
||||
if (IS_ERR(rk817_codec_data->mclk)) {
|
||||
dev_dbg(&pdev->dev, "Unable to get mclk\n");
|
||||
ret = -ENXIO;
|
||||
|
|
Загрузка…
Ссылка в новой задаче