Subject: Re: [PATCH 3/5] sh_eth: Simplify MDIO bus initialization and release

From: Sergei Shtylyov <[email-masked]>
Date: Thu, 20 Mar 2014 19:31:13 +0400

On 20-03-2014 18:00, Laurent Pinchart wrote:

> The network device passed to the sh_mdio_init and sh_mdio_release
> functions is only used to access the sh_eth_private instance. Pass it
> directly to those functions.

    The changelog is incomplete now. You added significant changes but forgot 
to document them.

> Signed-off-by: Laurent Pinchart <[email-masked]>
> Acked-by: Geert Uytterhoeven <[email-masked]>
> ---
>   drivers/net/ethernet/renesas/sh_eth.c | 30 +++++++++++-------------------
>   1 file changed, 11 insertions(+), 19 deletions(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 443f14f..e9224f2 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -2583,29 +2583,24 @@ static void sh_eth_tsu_init(struct sh_eth_private *mdp)
[...]
> -static int sh_mdio_init(struct net_device *ndev, int id,
> +static int sh_mdio_init(struct sh_eth_private *mdp,
>   			struct sh_eth_plat_data *pd)
>   {
>   	int ret, i;
>   	struct bb_info *bitbang;
> -	struct sh_eth_private *mdp = netdev_priv(ndev);
> +	struct platform_device *pdev = mdp->pdev;
>   	struct device *dev = &mdp->pdev->dev;

	struct device *dev = &pdev->dev;

> @@ -2635,7 +2630,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
>   	mdp->mii_bus->name = "sh_mii";
>   	mdp->mii_bus->parent = dev;
>   	snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
> -		 mdp->pdev->name, id);
> +		 pdev->name, pdev->id);
>
>   	/* PHY IRQ */
>   	mdp->mii_bus->irq = devm_kzalloc(dev, sizeof(int) * PHY_MAX_ADDR,

WBR, Sergei