[PATCH 09/11] drm/mxsfb: Move pm_runtime_enable at the end of probe
From: Robert Chiras
Date: Wed Jan 16 2019 - 06:49:10 EST
Move the pm_runtime_enable call at the end of probbe, since it was made too
early, causing issues to DRM enable routines.
Signed-off-by: Robert Chiras <robert.chiras@xxxxxxx>
---
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 3032007..9247c76 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -301,12 +301,10 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
if (ret)
return ret;
- pm_runtime_enable(drm->dev);
-
ret = drm_vblank_init(drm, MAX_CRTCS);
if (ret < 0) {
dev_err(drm->dev, "Failed to initialise vblank\n");
- goto err_vblank;
+ return ret;
}
/* Modeset init */
@@ -315,7 +313,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
ret = mxsfb_create_output(drm);
if (ret < 0) {
dev_err(drm->dev, "Failed to create outputs\n");
- goto err_vblank;
+ return ret;
}
ret = drm_simple_display_pipe_init(drm, &mxsfb->pipe, &mxsfb_funcs,
@@ -323,7 +321,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
mxsfb->connector);
if (ret < 0) {
dev_err(drm->dev, "Cannot setup simple display pipe\n");
- goto err_vblank;
+ return ret;
}
drm_crtc_vblank_off(&mxsfb->pipe.crtc);
@@ -340,14 +338,14 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
ret = drm_panel_attach(mxsfb->panel, mxsfb->connector);
if (ret) {
dev_err(drm->dev, "Cannot connect panel\n");
- goto err_vblank;
+ return ret;
}
} else if (mxsfb->bridge) {
ret = drm_simple_display_pipe_attach_bridge(&mxsfb->pipe,
mxsfb->bridge);
if (ret) {
dev_err(drm->dev, "Cannot connect bridge\n");
- goto err_vblank;
+ return ret;
}
}
@@ -367,9 +365,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
drm_mode_config_reset(drm);
- pm_runtime_get_sync(drm->dev);
ret = drm_irq_install(drm, platform_get_irq(pdev, 0));
- pm_runtime_put_sync(drm->dev);
if (ret < 0) {
dev_err(drm->dev, "Failed to install IRQ handler\n");
@@ -391,14 +387,14 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
drm_helper_hpd_irq_event(drm);
+ pm_runtime_enable(drm->dev);
+
return 0;
err_cma:
drm_irq_uninstall(drm);
err_irq:
drm_panel_detach(mxsfb->panel);
-err_vblank:
- pm_runtime_disable(drm->dev);
return ret;
}
--
2.7.4