[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180620080356.11900-3-brgl@bgdev.pl>
Date: Wed, 20 Jun 2018 10:03:56 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Grygorii Strashko <grygorii.strashko@...com>,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>,
Rob Herring <robh@...nel.org>, Lukas Wunner <lukas@...ner.de>,
Kevin Hilman <khilman@...nel.org>,
David Lechner <david@...hnology.com>,
Sekhar Nori <nsekhar@...com>, Andrew Lunn <andrew@...n.ch>
Cc: linux-omap@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH v2 2/2] net: davinci_emac: match the mdio device against its compatible if possible
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
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@...libre.com>
---
drivers/net/ethernet/ti/davinci_emac.c | 4 ++++
1 file changed, 4 insertions(+)
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)
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);
}
--
2.17.1
Powered by blists - more mailing lists