Skip to content

Commit bf5849f

Browse files
robherringdavem330
authored andcommitted
net: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which all of these are. Cc: "David S. Miller" <davem@davemloft.net> Cc: Claudiu Manoil <claudiu.manoil@nxp.com> Cc: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Wingman Kwok <w-kwok2@ti.com> Cc: Murali Karicheri <m-karicheri2@ti.com> Cc: netdev@vger.kernel.org Cc: linux-omap@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d66280b commit bf5849f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

drivers/net/ethernet/amd/sunlance.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,9 +1488,9 @@ static int sunlance_sbus_probe(struct platform_device *op)
14881488
struct device_node *parent_dp = parent->dev.of_node;
14891489
int err;
14901490

1491-
if (!strcmp(parent_dp->name, "ledma")) {
1491+
if (of_node_name_eq(parent_dp, "ledma")) {
14921492
err = sparc_lance_probe_one(op, parent, NULL);
1493-
} else if (!strcmp(parent_dp->name, "lebuffer")) {
1493+
} else if (of_node_name_eq(parent_dp, "lebuffer")) {
14941494
err = sparc_lance_probe_one(op, NULL, parent);
14951495
} else
14961496
err = sparc_lance_probe_one(op, NULL, NULL);

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static int gfar_of_group_count(struct device_node *np)
720720
int num = 0;
721721

722722
for_each_available_child_of_node(np, child)
723-
if (!of_node_cmp(child->name, "queue-group"))
723+
if (of_node_name_eq(child, "queue-group"))
724724
num++;
725725

726726
return num;
@@ -838,7 +838,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
838838
/* Parse and initialize group specific information */
839839
if (priv->mode == MQ_MG_MODE) {
840840
for_each_available_child_of_node(np, child) {
841-
if (of_node_cmp(child->name, "queue-group"))
841+
if (!of_node_name_eq(child, "queue-group"))
842842
continue;
843843

844844
err = gfar_parse_group(child, priv, model);

drivers/net/ethernet/sun/sunhme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
26912691
sbus_dp = op->dev.parent->of_node;
26922692

26932693
/* We can match PCI devices too, do not accept those here. */
2694-
if (strcmp(sbus_dp->name, "sbus") && strcmp(sbus_dp->name, "sbi"))
2694+
if (!of_node_name_eq(sbus_dp, "sbus") && !of_node_name_eq(sbus_dp, "sbi"))
26952695
return err;
26962696

26972697
if (is_qfe) {

drivers/net/ethernet/ti/cpsw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,7 +3271,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
32713271
const __be32 *parp;
32723272

32733273
/* This is no slave child node, continue */
3274-
if (strcmp(slave_node->name, "slave"))
3274+
if (!of_node_name_eq(slave_node, "slave"))
32753275
continue;
32763276

32773277
slave_data->phy_node = of_parse_phandle(slave_node,
@@ -3367,7 +3367,7 @@ static void cpsw_remove_dt(struct platform_device *pdev)
33673367
for_each_available_child_of_node(node, slave_node) {
33683368
struct cpsw_slave_data *slave_data = &data->slave_data[i];
33693369

3370-
if (strcmp(slave_node->name, "slave"))
3370+
if (!of_node_name_eq(slave_node, "slave"))
33713371
continue;
33723372

33733373
if (of_phy_is_fixed_link(slave_node))

drivers/net/ethernet/ti/netcp_ethss.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,7 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
36233623
return -EINVAL;
36243624
}
36253625

3626-
if (!strcmp(node->name, "gbe")) {
3626+
if (of_node_name_eq(node, "gbe")) {
36273627
ret = get_gbe_resource_version(gbe_dev, node);
36283628
if (ret)
36293629
return ret;
@@ -3637,7 +3637,7 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
36373637
else
36383638
ret = -ENODEV;
36393639

3640-
} else if (!strcmp(node->name, "xgbe")) {
3640+
} else if (of_node_name_eq(node, "xgbe")) {
36413641
ret = set_xgbe_ethss10_priv(gbe_dev, node);
36423642
if (ret)
36433643
return ret;

0 commit comments

Comments
 (0)