aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/arm
diff options
context:
space:
mode:
authorBrian Starkey <brian.starkey@arm.com>2016-07-26 12:15:25 -0400
committerSean Paul <seanpaul@chromium.org>2016-07-26 13:23:58 -0400
commit3c31760e760c87eaa5fbcbb90d54ccab576429c8 (patch)
treed2e7e480eecbc6dbeb9a0a737ff1f055b8800a93 /drivers/gpu/drm/arm
parentc084c8dafce72bf67ad2bb7b873a4a732a9ce81c (diff)
drm/arm: mali-dp: Set crtc.port to the port instead of the endpoint
The CRTC's port pointer was being set to the endpoint node instead of the port. Fix that, and hold a reference on the port node. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469549725-19577-1-git-send-email-brian.starkey@arm.com
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r--drivers/gpu/drm/arm/malidp_drv.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index e5b44e92f8cf..4e61ea508b4e 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -257,6 +257,7 @@ static int malidp_bind(struct device *dev)
257{ 257{
258 struct resource *res; 258 struct resource *res;
259 struct drm_device *drm; 259 struct drm_device *drm;
260 struct device_node *ep;
260 struct malidp_drm *malidp; 261 struct malidp_drm *malidp;
261 struct malidp_hw_device *hwdev; 262 struct malidp_hw_device *hwdev;
262 struct platform_device *pdev = to_platform_device(dev); 263 struct platform_device *pdev = to_platform_device(dev);
@@ -360,11 +361,12 @@ static int malidp_bind(struct device *dev)
360 goto register_fail; 361 goto register_fail;
361 362
362 /* Set the CRTC's port so that the encoder component can find it */ 363 /* Set the CRTC's port so that the encoder component can find it */
363 malidp->crtc.port = of_graph_get_next_endpoint(dev->of_node, NULL); 364 ep = of_graph_get_next_endpoint(dev->of_node, NULL);
365 if (!ep)
366 goto port_fail;
367 malidp->crtc.port = of_get_next_parent(ep);
364 368
365 ret = component_bind_all(dev, drm); 369 ret = component_bind_all(dev, drm);
366 of_node_put(malidp->crtc.port);
367
368 if (ret) { 370 if (ret) {
369 DRM_ERROR("Failed to bind all components\n"); 371 DRM_ERROR("Failed to bind all components\n");
370 goto bind_fail; 372 goto bind_fail;
@@ -402,6 +404,9 @@ vblank_fail:
402irq_init_fail: 404irq_init_fail:
403 component_unbind_all(dev, drm); 405 component_unbind_all(dev, drm);
404bind_fail: 406bind_fail:
407 of_node_put(malidp->crtc.port);
408 malidp->crtc.port = NULL;
409port_fail:
405 drm_dev_unregister(drm); 410 drm_dev_unregister(drm);
406register_fail: 411register_fail:
407 malidp_de_planes_destroy(drm); 412 malidp_de_planes_destroy(drm);
@@ -435,6 +440,8 @@ static void malidp_unbind(struct device *dev)
435 malidp_de_irq_fini(drm); 440 malidp_de_irq_fini(drm);
436 drm_vblank_cleanup(drm); 441 drm_vblank_cleanup(drm);
437 component_unbind_all(dev, drm); 442 component_unbind_all(dev, drm);
443 of_node_put(malidp->crtc.port);
444 malidp->crtc.port = NULL;
438 drm_dev_unregister(drm); 445 drm_dev_unregister(drm);
439 malidp_de_planes_destroy(drm); 446 malidp_de_planes_destroy(drm);
440 drm_mode_config_cleanup(drm); 447 drm_mode_config_cleanup(drm);