projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ccc99b
)
[PATCH] sky2: don't hard code number of ports
author
Stephen Hemminger
<
[email protected]
>
Tue, 13 Jun 2006 08:17:28 +0000
(17:17 +0900)
committer
Linus Torvalds
<
[email protected]
>
Tue, 13 Jun 2006 20:16:41 +0000
(13:16 -0700)
It is cleaner, to not loop over both ports if only one exists.
Signed-off-by: Stephen Hemminger <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/net/sky2.c
patch
|
blob
|
history
diff --git
a/drivers/net/sky2.c
b/drivers/net/sky2.c
index 765c8f063512afdbcf3f1ea2bbb1e10767cf1361..6ad676d2cbc1b7c71ee01098452ca23a759b719f 100644
(file)
--- 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);