[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180810080526.27207-15-brgl@bgdev.pl>
Date: Fri, 10 Aug 2018 10:05:11 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Jonathan Corbet <corbet@....net>, Sekhar Nori <nsekhar@...com>,
Kevin Hilman <khilman@...nel.org>,
Russell King <linux@...linux.org.uk>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Boris Brezillon <boris.brezillon@...tlin.com>,
Marek Vasut <marek.vasut@...il.com>,
Richard Weinberger <richard@....at>,
Grygorii Strashko <grygorii.strashko@...com>,
"David S . Miller" <davem@...emloft.net>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Naren <naren.kernel@...il.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Lukas Wunner <lukas@...ner.de>,
Dan Carpenter <dan.carpenter@...cle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>,
Sven Van Asbroeck <svendev@...x.com>,
Paolo Abeni <pabeni@...hat.com>, Alban Bedel <albeu@...e.fr>,
Rob Herring <robh@...nel.org>,
David Lechner <david@...hnology.com>,
Andrew Lunn <andrew@...n.ch>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-omap@...r.kernel.org,
netdev@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH v2 14/29] net: simplify eth_platform_get_mac_address()
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
We don't need to use pci_device_to_OF_node() - we can retrieve
dev->of_node directly even for pci devices.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
net/ethernet/eth.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index ee28440f57c5..7f08105402c8 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -530,11 +530,7 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
const unsigned char *addr;
struct device_node *dp;
- if (dev_is_pci(dev))
- dp = pci_device_to_OF_node(to_pci_dev(dev));
- else
- dp = dev->of_node;
-
+ dp = dev->of_node;
addr = NULL;
if (dp)
addr = of_get_mac_address(dp);
--
2.18.0
Powered by blists - more mailing lists