diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2018-06-20 04:03:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-20 21:23:48 -0400 |
commit | ea0820bb771175c7d4192fc6f5b5c56b3c6d5239 (patch) | |
tree | f8e3dff8120609d5546b21ed50db7fecfd0e556f | |
parent | 6d8b834989f56066499cb25fd7d60169ed5e188b (diff) |
net: davinci_emac: match the mdio device against its compatible if possible
Device tree based systems without of_dev_auxdata will have the mdio
device named differently than "davinci_mdio(.0)". In this case use the
device's parent's compatible string for matching
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ti/davinci_emac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index a1a6445b5a7e..f270beebb428 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -1387,6 +1387,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) | |||
1387 | 1387 | ||
1388 | static int match_first_device(struct device *dev, void *data) | 1388 | static int match_first_device(struct device *dev, void *data) |
1389 | { | 1389 | { |
1390 | if (dev->parent && dev->parent->of_node) | ||
1391 | return of_device_is_compatible(dev->parent->of_node, | ||
1392 | "ti,davinci_mdio"); | ||
1393 | |||
1390 | return !strncmp(dev_name(dev), "davinci_mdio", 12); | 1394 | return !strncmp(dev_name(dev), "davinci_mdio", 12); |
1391 | } | 1395 | } |
1392 | 1396 | ||