Skip to contentSkip to conversation

net: dsa: mv88e6xxx: Fix W=1 warning with !CONFIG_OF

PATCH Applied Andrew Lunn 2 participants 2 messages Sep 1, 2020

Subsystems (4)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: mv88e6xxx: Fix W=1 warning with !CONFIG_OF

When building on platforms without device tree, e.g. amd64, W=1 gives a warning about mv88e6xxx_mdio_external_match being unused. Replace of_match_node() with of_device_is_compatible() to prevent this warning.

---
 drivers/net/dsa/mv88e6xxx/chip.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +2 -9
index ee3b1a6b1ea8..fc3f02168462 100644
@@ -3100,12 +3100,6 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
 	return 0;
 }
 
-static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
-	{ .compatible = "marvell,mv88e6xxx-mdio-external",
-	  .data = (void *)true },
-	{ },
-};
-
 static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip)
 
 {
@@ -3125,7 +3119,6 @@ static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip)
 static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip,
 				    struct device_node *np)
 {
-	const struct of_device_id *match;
 	struct device_node *child;
 	int err;
 
@@ -3143,8 +3136,8 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip,
 	 * bus.
 	 */
 	for_each_available_child_of_node(np, child) {
-		match = of_match_node(mv88e6xxx_mdio_external_match, child);
-		if (match) {
+		if (of_device_is_compatible(
+			    child, "marvell,mv88e6xxx-mdio-external")) {
 			err = mv88e6xxx_mdio_register(chip, child, true);
 			if (err) {
 				mv88e6xxx_mdios_unregister(chip);
Signature · 1 line
2.28.0