Skip to content

Commit 393194c

Browse files
morimotorobherring
authored andcommitted
media: xilinx-tpg: use new of_graph functions
Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Acked-by: Sakari Ailus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 78cd57b commit 393194c

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/media/platform/xilinx/xilinx-tpg.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/gpio/consumer.h>
1414
#include <linux/module.h>
1515
#include <linux/of.h>
16+
#include <linux/of_graph.h>
1617
#include <linux/platform_device.h>
1718
#include <linux/xilinx-v4l2-controls.h>
1819

@@ -711,22 +712,13 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
711712
{
712713
struct device *dev = xtpg->xvip.dev;
713714
struct device_node *node = xtpg->xvip.dev->of_node;
714-
struct device_node *ports;
715-
struct device_node *port;
716715
unsigned int nports = 0;
717716
bool has_endpoint = false;
718717

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) {
724719
const struct xvip_video_format *format;
725720
struct device_node *endpoint;
726721

727-
if (!of_node_name_eq(port, "port"))
728-
continue;
729-
730722
format = xvip_of_get_format(port);
731723
if (IS_ERR(format)) {
732724
dev_err(dev, "invalid format in DT");
@@ -744,7 +736,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
744736
}
745737

746738
if (nports == 0) {
747-
endpoint = of_get_next_child(port, NULL);
739+
endpoint = of_graph_get_next_port_endpoint(port, NULL);
748740
if (endpoint)
749741
has_endpoint = true;
750742
of_node_put(endpoint);

0 commit comments

Comments
 (0)