diff options
Diffstat (limited to 'drivers/net/tg3.c')
| -rw-r--r-- | drivers/net/tg3.c | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 852e917778f8..6f97b7bbcbf1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -9948,16 +9948,16 @@ static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)  	    !((tp->tg3_flags & TG3_FLAG_WOL_CAP) && device_can_wakeup(dp)))  		return -EINVAL; +	device_set_wakeup_enable(dp, wol->wolopts & WAKE_MAGIC); +  	spin_lock_bh(&tp->lock); -	if (wol->wolopts & WAKE_MAGIC) { +	if (device_may_wakeup(dp))  		tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; -		device_set_wakeup_enable(dp, true); -	} else { +	else  		tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE; -		device_set_wakeup_enable(dp, false); -	}  	spin_unlock_bh(&tp->lock); +  	return 0;  } @@ -12658,7 +12658,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)  			cnt = pci_read_vpd(tp->pdev, pos,  					   TG3_NVM_VPD_LEN - pos,  					   &vpd_data[pos]); -			if (cnt == -ETIMEDOUT || -EINTR) +			if (cnt == -ETIMEDOUT || cnt == -EINTR)  				cnt = 0;  			else if (cnt < 0)  				goto out_not_found;  | 
