mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
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>
This commit is contained in:
parent
6d8b834989
commit
ea0820bb77
@ -1387,6 +1387,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
|
||||
|
||||
static int match_first_device(struct device *dev, void *data)
|
||||
{
|
||||
if (dev->parent && dev->parent->of_node)
|
||||
return of_device_is_compatible(dev->parent->of_node,
|
||||
"ti,davinci_mdio");
|
||||
|
||||
return !strncmp(dev_name(dev), "davinci_mdio", 12);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user