summaryrefslogtreecommitdiff
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-06-13 17:17:28 +0900
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-13 13:16:41 -0700
commitf05267e7dee58741a4feb20d0351706ec64bb0b5 (patch)
treeb99907cae2801309761a1c89bbd57e642c3aff24 /drivers/net/sky2.c
parent2ccc99b7b71976d15822ae7c41cd2ccda66d5076 (diff)
downloadlwn-f05267e7dee58741a4feb20d0351706ec64bb0b5.tar.gz
lwn-f05267e7dee58741a4feb20d0351706ec64bb0b5.zip
[PATCH] sky2: don't hard code number of ports
It is cleaner, to not loop over both ports if only one exists. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 765c8f063512..6ad676d2cbc1 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3430,7 +3430,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
return -EINVAL;
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
if (dev) {
@@ -3460,7 +3460,7 @@ static int sky2_resume(struct pci_dev *pdev)
if (err)
goto out;
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
if (dev && netif_running(dev)) {
netif_device_attach(dev);