mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
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 <kuninori.morimoto.gx@renesas.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/87a5eub5s8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
parent
78cd57bbb4
commit
393194cdf1
1 changed files with 3 additions and 11 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_graph.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/xilinx-v4l2-controls.h>
|
#include <linux/xilinx-v4l2-controls.h>
|
||||||
|
|
||||||
|
@ -711,22 +712,13 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
|
||||||
{
|
{
|
||||||
struct device *dev = xtpg->xvip.dev;
|
struct device *dev = xtpg->xvip.dev;
|
||||||
struct device_node *node = xtpg->xvip.dev->of_node;
|
struct device_node *node = xtpg->xvip.dev->of_node;
|
||||||
struct device_node *ports;
|
|
||||||
struct device_node *port;
|
|
||||||
unsigned int nports = 0;
|
unsigned int nports = 0;
|
||||||
bool has_endpoint = false;
|
bool has_endpoint = false;
|
||||||
|
|
||||||
ports = of_get_child_by_name(node, "ports");
|
for_each_of_graph_port(node, port) {
|
||||||
if (ports == NULL)
|
|
||||||
ports = node;
|
|
||||||
|
|
||||||
for_each_child_of_node(ports, port) {
|
|
||||||
const struct xvip_video_format *format;
|
const struct xvip_video_format *format;
|
||||||
struct device_node *endpoint;
|
struct device_node *endpoint;
|
||||||
|
|
||||||
if (!of_node_name_eq(port, "port"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
format = xvip_of_get_format(port);
|
format = xvip_of_get_format(port);
|
||||||
if (IS_ERR(format)) {
|
if (IS_ERR(format)) {
|
||||||
dev_err(dev, "invalid format in DT");
|
dev_err(dev, "invalid format in DT");
|
||||||
|
@ -744,7 +736,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nports == 0) {
|
if (nports == 0) {
|
||||||
endpoint = of_get_next_child(port, NULL);
|
endpoint = of_graph_get_next_port_endpoint(port, NULL);
|
||||||
if (endpoint)
|
if (endpoint)
|
||||||
has_endpoint = true;
|
has_endpoint = true;
|
||||||
of_node_put(endpoint);
|
of_node_put(endpoint);
|
||||||
|
|
Loading…
Add table
Reference in a new issue