return ret;
}
+ ret = clk_set_parent(mdata->sel_clk, mdata->parent_clk);
+ if (ret < 0) {
+ dev_err(dev, "failed to clk_set_parent (%d)\n", ret);
+ return ret;
+ }
+
ret = clk_prepare_enable(mdata->spi_hclk);
if (ret < 0) {
dev_err(dev, "failed to enable hclk (%d)\n", ret);
ret = clk_prepare_enable(mdata->spi_clk);
if (ret < 0) {
dev_err(dev, "failed to enable spi_clk (%d)\n", ret);
- goto err_disable_spi_hclk;
- }
-
- ret = clk_set_parent(mdata->sel_clk, mdata->parent_clk);
- if (ret < 0) {
- dev_err(dev, "failed to clk_set_parent (%d)\n", ret);
- goto err_disable_spi_clk;
+ clk_disable_unprepare(mdata->spi_hclk);
+ return ret;
}
mdata->spi_clk_hz = clk_get_rate(mdata->spi_clk);
err_disable_runtime_pm:
pm_runtime_disable(dev);
-err_disable_spi_clk:
- clk_disable_unprepare(mdata->spi_clk);
-err_disable_spi_hclk:
- clk_disable_unprepare(mdata->spi_hclk);
return ret;
}