diff options
author | Dave Airlie <airlied@redhat.com> | 2015-04-13 03:28:16 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-04-13 03:28:16 -0400 |
commit | bb1dc08c94ead1b98e750caf535422f79363c1a2 (patch) | |
tree | 8e1db4d7b2de470223c7a98aca3e2f47d6d5ed83 /drivers/gpu/drm/rcar-du | |
parent | a7d6883619584c2dbeeb5f6a1cf86cde6a3993de (diff) | |
parent | ecaa4902222fd4d28692203bec028513fbac29c7 (diff) |
Merge tag 'of-graph-drm-2015-04-08' of git://git.pengutronix.de/git/pza/linux into drm-next
drm: Use of-graph helpers to loop over endpoints
Convert all drm callers that use of_graph_get_next_endpoint to loop over
of-graph endpoints to the newly introduced for_each_endpoint_of_node
helper macro.
* tag 'of-graph-drm-2015-04-08' of git://git.pengutronix.de/git/pza/linux:
drm/rockchip: use for_each_endpoint_of_node macro, drop endpoint reference on break
drm/rcar-du: use for_each_endpoint_of_node macro
drm/imx: use for_each_endpoint_of_node macro in imx_drm_encoder_get_mux_id
drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs
of: Explicitly include linux/types.h in of_graph.h
dt-bindings: brcm: rationalize Broadcom documentation naming
of/unittest: replace 'selftest' with 'unittest'
Documentation: rename of_selftest.txt to of_unittest.txt
Documentation: update the of_selftest.txt
dt: OF_UNITTEST make dependency broken
MAINTAINERS: Pantelis Antoniou device tree overlay maintainer
of: Add of_graph_get_port_by_id function
of: Add for_each_endpoint_of_node helper macro
of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_kms.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index fb052bca574f..93117f159a3b 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c | |||
@@ -509,7 +509,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, | |||
509 | enum rcar_du_encoder_type enc_type = RCAR_DU_ENCODER_NONE; | 509 | enum rcar_du_encoder_type enc_type = RCAR_DU_ENCODER_NONE; |
510 | struct device_node *connector = NULL; | 510 | struct device_node *connector = NULL; |
511 | struct device_node *encoder = NULL; | 511 | struct device_node *encoder = NULL; |
512 | struct device_node *prev = NULL; | 512 | struct device_node *ep_node = NULL; |
513 | struct device_node *entity_ep_node; | 513 | struct device_node *entity_ep_node; |
514 | struct device_node *entity; | 514 | struct device_node *entity; |
515 | int ret; | 515 | int ret; |
@@ -527,16 +527,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, | |||
527 | 527 | ||
528 | entity_ep_node = of_parse_phandle(ep->local_node, "remote-endpoint", 0); | 528 | entity_ep_node = of_parse_phandle(ep->local_node, "remote-endpoint", 0); |
529 | 529 | ||
530 | while (1) { | 530 | for_each_endpoint_of_node(entity, ep_node) { |
531 | struct device_node *ep_node; | ||
532 | |||
533 | ep_node = of_graph_get_next_endpoint(entity, prev); | ||
534 | of_node_put(prev); | ||
535 | prev = ep_node; | ||
536 | |||
537 | if (!ep_node) | ||
538 | break; | ||
539 | |||
540 | if (ep_node == entity_ep_node) | 531 | if (ep_node == entity_ep_node) |
541 | continue; | 532 | continue; |
542 | 533 | ||
@@ -603,27 +594,19 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, | |||
603 | static int rcar_du_encoders_init(struct rcar_du_device *rcdu) | 594 | static int rcar_du_encoders_init(struct rcar_du_device *rcdu) |
604 | { | 595 | { |
605 | struct device_node *np = rcdu->dev->of_node; | 596 | struct device_node *np = rcdu->dev->of_node; |
606 | struct device_node *prev = NULL; | 597 | struct device_node *ep_node; |
607 | unsigned int num_encoders = 0; | 598 | unsigned int num_encoders = 0; |
608 | 599 | ||
609 | /* | 600 | /* |
610 | * Iterate over the endpoints and create one encoder for each output | 601 | * Iterate over the endpoints and create one encoder for each output |
611 | * pipeline. | 602 | * pipeline. |
612 | */ | 603 | */ |
613 | while (1) { | 604 | for_each_endpoint_of_node(np, ep_node) { |
614 | struct device_node *ep_node; | ||
615 | enum rcar_du_output output; | 605 | enum rcar_du_output output; |
616 | struct of_endpoint ep; | 606 | struct of_endpoint ep; |
617 | unsigned int i; | 607 | unsigned int i; |
618 | int ret; | 608 | int ret; |
619 | 609 | ||
620 | ep_node = of_graph_get_next_endpoint(np, prev); | ||
621 | of_node_put(prev); | ||
622 | prev = ep_node; | ||
623 | |||
624 | if (ep_node == NULL) | ||
625 | break; | ||
626 | |||
627 | ret = of_graph_parse_endpoint(ep_node, &ep); | 610 | ret = of_graph_parse_endpoint(ep_node, &ep); |
628 | if (ret < 0) { | 611 | if (ret < 0) { |
629 | of_node_put(ep_node); | 612 | of_node_put(ep_node); |