[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180515215930.12115-2-f.fainelli@gmail.com>
Date: Tue, 15 May 2018 14:59:29 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: netdev@...r.kernel.org
Cc: Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
"David S. Miller" <davem@...emloft.net>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Fugang Duan <fugang.duan@....com>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...com>,
Jose Abreu <joabreu@...opsys.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Woojung Huh <woojung.huh@...rochip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Antoine Tenart <antoine.tenart@...e-electrons.com>,
Tobias Jordan <Tobias.Jordan@...ktrobit.com>,
Russell King <rmk+kernel@...linux.org.uk>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>,
Simon Horman <horms+renesas@...ge.net.au>,
Maxim Uvarov <muvarov@...il.com>, Sekhar Nori <nsekhar@...com>,
linux-kernel@...r.kernel.org (open list),
linux-renesas-soc@...r.kernel.org (open list:RENESAS ETHERNET DRIVERS),
linux-omap@...r.kernel.org (open list:TI ETHERNET SWITCH DRIVER (CPSW)),
linux-usb@...r.kernel.org (open list:USB NETWORKING DRIVERS),
devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED
DEVICE TREE)
Subject: [PATCH net-next 1/2] of: mdio: Fall back to mdiobus_register() with np is NULL
When the Device Tree node specified is NULL, fall back to
mdiobus_register(). We have a number of drivers having a similar pattern
which is:
if (np)
of_mdiobus_register()
else
mdiobus_register()
so incorporate that behavior within the core of_mdiobus_register()
function. This is also consistent with the stub version that we defined
when CONFIG_OF=n.
Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
drivers/of/of_mdio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 8c0c92712fc9..2341dbf675bf 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -204,6 +204,12 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
bool scanphys = false;
int addr, rc;
+ /* If the Device Tree node does not exist, fall back to traditional
+ * registration
+ */
+ if (!np)
+ return mdiobus_register(mdio);
+
/* Do not continue if the node is disabled */
if (!of_device_is_available(np))
return -ENODEV;
--
2.14.1
Powered by blists - more mailing lists