13
13
#include <linux/gpio/consumer.h>
14
14
#include <linux/module.h>
15
15
#include <linux/of.h>
16
+ #include <linux/of_graph.h>
16
17
#include <linux/platform_device.h>
17
18
#include <linux/xilinx-v4l2-controls.h>
18
19
@@ -711,22 +712,13 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
711
712
{
712
713
struct device * dev = xtpg -> xvip .dev ;
713
714
struct device_node * node = xtpg -> xvip .dev -> of_node ;
714
- struct device_node * ports ;
715
- struct device_node * port ;
716
715
unsigned int nports = 0 ;
717
716
bool has_endpoint = false;
718
717
719
- ports = of_get_child_by_name (node , "ports" );
720
- if (ports == NULL )
721
- ports = node ;
722
-
723
- for_each_child_of_node (ports , port ) {
718
+ for_each_of_graph_port (node , port ) {
724
719
const struct xvip_video_format * format ;
725
720
struct device_node * endpoint ;
726
721
727
- if (!of_node_name_eq (port , "port" ))
728
- continue ;
729
-
730
722
format = xvip_of_get_format (port );
731
723
if (IS_ERR (format )) {
732
724
dev_err (dev , "invalid format in DT" );
@@ -744,7 +736,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
744
736
}
745
737
746
738
if (nports == 0 ) {
747
- endpoint = of_get_next_child (port , NULL );
739
+ endpoint = of_graph_get_next_port_endpoint (port , NULL );
748
740
if (endpoint )
749
741
has_endpoint = true;
750
742
of_node_put (endpoint );
0 commit comments