Re: [PATCH v3 net-next 1/4] net: macb: Reorganize macb_mii bringup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <brad.mouring@xxxxxx>
> Suggested-by: Andrew Lunn <andrew@xxxxxxx>

Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>

> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux