Subject: [RFT 2/5] 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 <[EMAIL PROTECTED]>

--- test.orig/drivers/net/sky2.c
+++ test/drivers/net/sky2.c
@@ -3430,7 +3430,7 @@ static int sky2_suspend(struct pci_dev *
        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 *p
        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);

--

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to