Subject: [PATCH v2 7/8] net/fec: fix pm to survive to suspend/resume

From: [email-masked] (Sergei Shtylyov)
Date: Thu, 27 May 2010 14:37:03 +0400

Hello.

Eric B?nard wrote:

> * with this patch, if the connection if active before suspend, it
> will be active after resume.
> * before this patch, it was necessary to close the interface and
> reopen it to recover the connection.

> Signed-off-by: Eric B?nard <[email-masked]>

> diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> index 9b4e8f7..654abaf 100644
> --- a/drivers/net/fec.c
> +++ b/drivers/net/fec.c
> @@ -1971,13 +1971,14 @@ static int
>  fec_suspend(struct platform_device *dev, pm_message_t state)
>  {
>  	struct net_device *ndev = platform_get_drvdata(dev);
> -	struct fec_enet_private *fep;
> +	struct fec_enet_private *fep = netdev_priv(ndev);

    Can netdev_priv() be called if 'ndev' is NULL (and can it be really 
NULL?)?

>  	if (ndev) {
>  		fep = netdev_priv(ndev);

    Duplicated now.

WBR, Sergei