Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Brian Starkey and committed by
Sean Paul
3c31760e c084c8da

+10 -3
+10 -3
drivers/gpu/drm/arm/malidp_drv.c
··· 257 257 { 258 258 struct resource *res; 259 259 struct drm_device *drm; 260 + struct device_node *ep; 260 261 struct malidp_drm *malidp; 261 262 struct malidp_hw_device *hwdev; 262 263 struct platform_device *pdev = to_platform_device(dev); ··· 361 360 goto register_fail; 362 361 363 362 /* Set the CRTC's port so that the encoder component can find it */ 364 - malidp->crtc.port = of_graph_get_next_endpoint(dev->of_node, NULL); 363 + ep = of_graph_get_next_endpoint(dev->of_node, NULL); 364 + if (!ep) 365 + goto port_fail; 366 + malidp->crtc.port = of_get_next_parent(ep); 365 367 366 368 ret = component_bind_all(dev, drm); 367 - of_node_put(malidp->crtc.port); 368 - 369 369 if (ret) { 370 370 DRM_ERROR("Failed to bind all components\n"); 371 371 goto bind_fail; ··· 404 402 irq_init_fail: 405 403 component_unbind_all(dev, drm); 406 404 bind_fail: 405 + of_node_put(malidp->crtc.port); 406 + malidp->crtc.port = NULL; 407 + port_fail: 407 408 drm_dev_unregister(drm); 408 409 register_fail: 409 410 malidp_de_planes_destroy(drm); ··· 440 435 malidp_de_irq_fini(drm); 441 436 drm_vblank_cleanup(drm); 442 437 component_unbind_all(dev, drm); 438 + of_node_put(malidp->crtc.port); 439 + malidp->crtc.port = NULL; 443 440 drm_dev_unregister(drm); 444 441 malidp_de_planes_destroy(drm); 445 442 drm_mode_config_cleanup(drm);