Subject: Re: [RFC] [POWERPC] Add support for PHY-less fs_enet operation

From: Scott Wood <[email-masked]>
Date: Mon, 05 Nov 2007 13:04:33 -0600

Jochen Friedrich wrote:
> diff --git a/drivers/net/fs_enet/fs_enet-main.c 
> b/drivers/net/fs_enet/fs_enet-main.c
> index f2a4d39..e142eff 100644
> --- a/drivers/net/fs_enet/fs_enet-main.c
> +++ b/drivers/net/fs_enet/fs_enet-main.c
> @@ -702,13 +702,16 @@ static void fs_timeout(struct net_device *dev)
>     spin_lock_irqsave(&fep->lock, flags);
> 
>     if (dev->flags & IFF_UP) {
> -        phy_stop(fep->phydev);
> +        if (fep->phydev)
> +            phy_stop(fep->phydev);
>         (*fep->ops->stop)(dev);
>         (*fep->ops->restart)(dev);
> -        phy_start(fep->phydev);
> +        if (fep->phydev)
> +            phy_start(fep->phydev);
>     }

It might be nice if phy_stop/phy_start/etc. were made to accept NULL 
parameters as no-ops to make things easier on drivers that support 
phyless operation...

-Scott