Re: [PATCH v3 1/9] ethernet: add sun8i-emac driver

2016-09-13 Thread LABBE Corentin
On Fri, Sep 09, 2016 at 04:15:27PM +0200, Andrew Lunn wrote: > Hi Corentin > > > +static int sun8i_emac_mdio_register(struct net_device *ndev) > > +{ > > + struct sun8i_emac_priv *priv = netdev_priv(ndev); > > + struct mii_bus *bus; > > + int ret; > > + > > + bus = mdiobus_alloc(); > > Yo

Re: [PATCH v3 1/9] ethernet: add sun8i-emac driver

2016-09-09 Thread Andrew Lunn
Hi Corentin > +static int sun8i_emac_mdio_register(struct net_device *ndev) > +{ > + struct sun8i_emac_priv *priv = netdev_priv(ndev); > + struct mii_bus *bus; > + int ret; > + > + bus = mdiobus_alloc(); You can use devm_mdiobus_alloc() which will simplify your error handling and

[PATCH v3 1/9] ethernet: add sun8i-emac driver

2016-09-09 Thread Corentin Labbe
This patch add support for sun8i-emac ethernet MAC hardware. It could be found in Allwinner H3/A83T/A64 SoCs. It supports 10/100/1000 Mbit/s speed with half/full duplex. It can use an internal PHY (MII 10/100) or an external PHY via RGMII/RMII. Signed-off-by: Corentin Labbe --- drivers/net/ethe