if (vop->is_enabled)
return;
- ret = pm_runtime_get_sync(vop->dev);
- if (ret < 0) {
- dev_err(vop->dev, "failed to get pm runtime: %d\n", ret);
- return;
- }
-
ret = clk_enable(vop->hclk);
if (ret < 0) {
dev_err(vop->dev, "failed to enable hclk - %d\n", ret);
goto err_disable_dclk;
}
+ ret = pm_runtime_get_sync(vop->dev);
+ if (ret < 0) {
+ dev_err(vop->dev, "failed to get pm runtime: %d\n", ret);
+ return;
+ }
+
/*
* Slave iommu shares power, irq and clock with vop. It was associated
* automatically with this master device via common driver code.
*/
rockchip_drm_dma_detach_device(vop->drm_dev, vop->dev);
+ pm_runtime_put(vop->dev);
clk_disable(vop->dclk);
clk_disable(vop->aclk);
clk_disable(vop->hclk);
- pm_runtime_put(vop->dev);
}
static void vop_plane_destroy(struct drm_plane *plane)