Commit ceb96fae authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

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.
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0697fecf
...@@ -3329,12 +3329,6 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip, ...@@ -3329,12 +3329,6 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
return 0; 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) static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip)
{ {
...@@ -3354,7 +3348,6 @@ static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) ...@@ -3354,7 +3348,6 @@ static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip)
static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip,
struct device_node *np) struct device_node *np)
{ {
const struct of_device_id *match;
struct device_node *child; struct device_node *child;
int err; int err;
...@@ -3372,8 +3365,8 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, ...@@ -3372,8 +3365,8 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip,
* bus. * bus.
*/ */
for_each_available_child_of_node(np, child) { for_each_available_child_of_node(np, child) {
match = of_match_node(mv88e6xxx_mdio_external_match, child); if (of_device_is_compatible(
if (match) { child, "marvell,mv88e6xxx-mdio-external")) {
err = mv88e6xxx_mdio_register(chip, child, true); err = mv88e6xxx_mdio_register(chip, child, true);
if (err) { if (err) {
mv88e6xxx_mdios_unregister(chip); mv88e6xxx_mdios_unregister(chip);
......
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