Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5eb5cb9 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Greg Kroah-Hartman
Browse files

net: davinci_emac: match the mdio device against its compatible if possible



[ Upstream commit ea0820bb771175c7d4192fc6f5b5c56b3c6d5239 ]

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: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d4a1dd4e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1514,6 +1514,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);
}