Commit 2fc6e404 authored by Rob Herring's avatar Rob Herring Committed by Mauro Carvalho Chehab

media: Use of_node_name_eq for node name comparisons

Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Hyun Kwon <hyun.kwon@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarBenoit Parrot <bparrot@ti.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent de2563bc
...@@ -445,7 +445,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, ...@@ -445,7 +445,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
*/ */
np = of_get_parent(rem); np = of_get_parent(rem);
if (np && !of_node_cmp(np->name, "i2c-isp")) if (of_node_name_eq(np, "i2c-isp"))
pd->fimc_bus_type = FIMC_BUS_TYPE_ISP_WRITEBACK; pd->fimc_bus_type = FIMC_BUS_TYPE_ISP_WRITEBACK;
else else
pd->fimc_bus_type = pd->sensor_bus_type; pd->fimc_bus_type = pd->sensor_bus_type;
...@@ -495,7 +495,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) ...@@ -495,7 +495,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd)
for_each_available_child_of_node(parent, node) { for_each_available_child_of_node(parent, node) {
struct device_node *port; struct device_node *port;
if (of_node_cmp(node->name, "csis")) if (!of_node_name_eq(node, "csis"))
continue; continue;
/* The csis node can have only port subnode. */ /* The csis node can have only port subnode. */
port = of_get_next_child(node, NULL); port = of_get_next_child(node, NULL);
...@@ -720,13 +720,13 @@ static int fimc_md_register_platform_entities(struct fimc_md *fmd, ...@@ -720,13 +720,13 @@ static int fimc_md_register_platform_entities(struct fimc_md *fmd,
continue; continue;
/* If driver of any entity isn't ready try all again later. */ /* If driver of any entity isn't ready try all again later. */
if (!strcmp(node->name, CSIS_OF_NODE_NAME)) if (of_node_name_eq(node, CSIS_OF_NODE_NAME))
plat_entity = IDX_CSIS; plat_entity = IDX_CSIS;
else if (!strcmp(node->name, FIMC_IS_OF_NODE_NAME)) else if (of_node_name_eq(node, FIMC_IS_OF_NODE_NAME))
plat_entity = IDX_IS_ISP; plat_entity = IDX_IS_ISP;
else if (!strcmp(node->name, FIMC_LITE_OF_NODE_NAME)) else if (of_node_name_eq(node, FIMC_LITE_OF_NODE_NAME))
plat_entity = IDX_FLITE; plat_entity = IDX_FLITE;
else if (!strcmp(node->name, FIMC_OF_NODE_NAME) && else if (of_node_name_eq(node, FIMC_OF_NODE_NAME) &&
!of_property_read_bool(node, "samsung,lcd-wb")) !of_property_read_bool(node, "samsung,lcd-wb"))
plat_entity = IDX_FIMC; plat_entity = IDX_FIMC;
......
...@@ -1615,7 +1615,7 @@ of_get_next_port(const struct device_node *parent, ...@@ -1615,7 +1615,7 @@ of_get_next_port(const struct device_node *parent,
return NULL; return NULL;
} }
prev = port; prev = port;
} while (of_node_cmp(port->name, "port") != 0); } while (!of_node_name_eq(port, "port"));
} }
return port; return port;
...@@ -1635,7 +1635,7 @@ of_get_next_endpoint(const struct device_node *parent, ...@@ -1635,7 +1635,7 @@ of_get_next_endpoint(const struct device_node *parent,
if (!ep) if (!ep)
return NULL; return NULL;
prev = ep; prev = ep;
} while (of_node_cmp(ep->name, "endpoint") != 0); } while (!of_node_name_eq(ep, "endpoint"));
return ep; return ep;
} }
......
...@@ -722,7 +722,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) ...@@ -722,7 +722,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
const struct xvip_video_format *format; const struct xvip_video_format *format;
struct device_node *endpoint; struct device_node *endpoint;
if (!port->name || of_node_cmp(port->name, "port")) if (!of_node_name_eq(port, "port"))
continue; continue;
format = xvip_of_get_format(port); format = xvip_of_get_format(port);
......
...@@ -564,8 +564,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode, ...@@ -564,8 +564,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
fwnode = fwnode_get_parent(__fwnode); fwnode = fwnode_get_parent(__fwnode);
fwnode_property_read_u32(fwnode, port_prop, &link->local_port); fwnode_property_read_u32(fwnode, port_prop, &link->local_port);
fwnode = fwnode_get_next_parent(fwnode); fwnode = fwnode_get_next_parent(fwnode);
if (is_of_node(fwnode) && if (is_of_node(fwnode) && of_node_name_eq(to_of_node(fwnode), "ports"))
of_node_cmp(to_of_node(fwnode)->name, "ports") == 0)
fwnode = fwnode_get_next_parent(fwnode); fwnode = fwnode_get_next_parent(fwnode);
link->local_node = fwnode; link->local_node = fwnode;
...@@ -578,8 +577,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode, ...@@ -578,8 +577,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode,
fwnode = fwnode_get_parent(fwnode); fwnode = fwnode_get_parent(fwnode);
fwnode_property_read_u32(fwnode, port_prop, &link->remote_port); fwnode_property_read_u32(fwnode, port_prop, &link->remote_port);
fwnode = fwnode_get_next_parent(fwnode); fwnode = fwnode_get_next_parent(fwnode);
if (is_of_node(fwnode) && if (is_of_node(fwnode) && of_node_name_eq(to_of_node(fwnode), "ports"))
of_node_cmp(to_of_node(fwnode)->name, "ports") == 0)
fwnode = fwnode_get_next_parent(fwnode); fwnode = fwnode_get_next_parent(fwnode);
link->remote_node = fwnode; link->remote_node = fwnode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment