提交 f05267e7 编写于 作者: S Stephen Hemminger 提交者: Linus Torvalds

[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: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 2ccc99b7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册