goto error_free_irq;
}
- ret = clk_prepare(st->clk);
+ ret = clk_prepare_enable(st->clk);
if (ret) {
- dev_err(&pdev->dev, "Could not prepare the clock.\n");
- goto error_free_clk;
- }
-
- ret = clk_enable(st->clk);
- if (ret) {
- dev_err(&pdev->dev, "Could not enable the clock.\n");
- goto error_unprepare_clk;
+ dev_err(&pdev->dev,
+ "Could not prepare or enable the clock.\n");
+ goto error_free_irq;
}
- st->adc_clk = clk_get(&pdev->dev, "adc_op_clk");
+ st->adc_clk = devm_clk_get(&pdev->dev, "adc_op_clk");
if (IS_ERR(st->adc_clk)) {
dev_err(&pdev->dev, "Failed to get the ADC clock.\n");
- ret = PTR_ERR(st->clk);
+ ret = PTR_ERR(st->adc_clk);
goto error_disable_clk;
}