Re: [PATCH v3 net-next 1/4] net: macb: Reorganize macb_mii bringup
From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2018-03-12 17:17:04
Also in:
netdev
On 03/12/2018 10:09 AM, Brad Mouring wrote:
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring <redacted> Suggested-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
quoted hunk ↗ jump to hunk
--- drivers/net/ethernet/cadence/macb_main.c | 79 +++++++++++++++++--------------- 1 file changed, 41 insertions(+), 38 deletions(-)diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index e84afcf1ecb5..9b6195fbbf8e 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c@@ -472,8 +472,42 @@ static int macb_mii_probe(struct net_device *dev) struct macb *bp = netdev_priv(dev); struct macb_platform_data *pdata; struct phy_device *phydev; - int phy_irq; - int ret; + struct device_node *np; + int phy_irq, ret, i; + + pdata = dev_get_platdata(&bp->pdev->dev); + np = bp->pdev->dev.of_node; + ret = 0; + + if (np) {
Nit: a future cleanup (not this patch series) should consider doing an early check on np to reduce the indentation. -- Florian