diff options
Diffstat (limited to 'drivers/gpu/drm/imx')
| -rw-r--r-- | drivers/gpu/drm/imx/imx-drm-core.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index a002f53aab0e..db2f5a739e05 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c | |||
| @@ -431,15 +431,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm, | |||
| 431 | } | 431 | } |
| 432 | EXPORT_SYMBOL_GPL(imx_drm_encoder_parse_of); | 432 | EXPORT_SYMBOL_GPL(imx_drm_encoder_parse_of); |
| 433 | 433 | ||
| 434 | static struct device_node *imx_drm_of_get_next_endpoint( | ||
| 435 | const struct device_node *parent, struct device_node *prev) | ||
| 436 | { | ||
| 437 | struct device_node *node = of_graph_get_next_endpoint(parent, prev); | ||
| 438 | |||
| 439 | of_node_put(prev); | ||
| 440 | return node; | ||
| 441 | } | ||
| 442 | |||
| 443 | /* | 434 | /* |
| 444 | * @node: device tree node containing encoder input ports | 435 | * @node: device tree node containing encoder input ports |
| 445 | * @encoder: drm_encoder | 436 | * @encoder: drm_encoder |
| @@ -448,7 +439,7 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, | |||
| 448 | struct drm_encoder *encoder) | 439 | struct drm_encoder *encoder) |
| 449 | { | 440 | { |
| 450 | struct imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc); | 441 | struct imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc); |
| 451 | struct device_node *ep = NULL; | 442 | struct device_node *ep; |
| 452 | struct of_endpoint endpoint; | 443 | struct of_endpoint endpoint; |
| 453 | struct device_node *port; | 444 | struct device_node *port; |
| 454 | int ret; | 445 | int ret; |
| @@ -456,18 +447,15 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, | |||
| 456 | if (!node || !imx_crtc) | 447 | if (!node || !imx_crtc) |
| 457 | return -EINVAL; | 448 | return -EINVAL; |
| 458 | 449 | ||
| 459 | do { | 450 | for_each_endpoint_of_node(node, ep) { |
| 460 | ep = imx_drm_of_get_next_endpoint(node, ep); | ||
| 461 | if (!ep) | ||
| 462 | break; | ||
| 463 | |||
| 464 | port = of_graph_get_remote_port(ep); | 451 | port = of_graph_get_remote_port(ep); |
| 465 | of_node_put(port); | 452 | of_node_put(port); |
| 466 | if (port == imx_crtc->crtc->port) { | 453 | if (port == imx_crtc->crtc->port) { |
| 467 | ret = of_graph_parse_endpoint(ep, &endpoint); | 454 | ret = of_graph_parse_endpoint(ep, &endpoint); |
| 455 | of_node_put(ep); | ||
| 468 | return ret ? ret : endpoint.port; | 456 | return ret ? ret : endpoint.port; |
| 469 | } | 457 | } |
| 470 | } while (ep); | 458 | } |
| 471 | 459 | ||
| 472 | return -EINVAL; | 460 | return -EINVAL; |
| 473 | } | 461 | } |
