mirror of https://github.com/torvalds/linux.git
iio: dac: vf610: Simplify with devm_clk_get_enabled()
Driver is getting clock and almost immediately enabling it, with no relevant code executed between, thus the probe path and cleanups can be simplified with devm_clk_get_enabled(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250713-iio-clk-get-enabled-v1-4-70abc1f9ce6c@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
89ef9c6be5
commit
9eca012a9f
|
|
@ -188,7 +188,7 @@ static int vf610_dac_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(info->regs))
|
if (IS_ERR(info->regs))
|
||||||
return PTR_ERR(info->regs);
|
return PTR_ERR(info->regs);
|
||||||
|
|
||||||
info->clk = devm_clk_get(&pdev->dev, "dac");
|
info->clk = devm_clk_get_enabled(&pdev->dev, "dac");
|
||||||
if (IS_ERR(info->clk))
|
if (IS_ERR(info->clk))
|
||||||
return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
|
return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
|
||||||
"Failed getting clock\n");
|
"Failed getting clock\n");
|
||||||
|
|
@ -203,13 +203,6 @@ static int vf610_dac_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
mutex_init(&info->lock);
|
mutex_init(&info->lock);
|
||||||
|
|
||||||
ret = clk_prepare_enable(info->clk);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Could not prepare or enable the clock\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
vf610_dac_init(info);
|
vf610_dac_init(info);
|
||||||
|
|
||||||
ret = iio_device_register(indio_dev);
|
ret = iio_device_register(indio_dev);
|
||||||
|
|
@ -222,7 +215,6 @@ static int vf610_dac_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
error_iio_device_register:
|
error_iio_device_register:
|
||||||
vf610_dac_exit(info);
|
vf610_dac_exit(info);
|
||||||
clk_disable_unprepare(info->clk);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +226,6 @@ static void vf610_dac_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
iio_device_unregister(indio_dev);
|
iio_device_unregister(indio_dev);
|
||||||
vf610_dac_exit(info);
|
vf610_dac_exit(info);
|
||||||
clk_disable_unprepare(info->clk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vf610_dac_suspend(struct device *dev)
|
static int vf610_dac_suspend(struct device *dev)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue