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

Scott Wood scottwood at freescale.com
Tue Nov 6 06:04:33 EST 2007


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


More information about the Linuxppc-embedded mailing list