Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f05267e7 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Linus Torvalds
Browse files

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2ccc99b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3430,7 +3430,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
	if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
	if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
		return -EINVAL;
		return -EINVAL;


	for (i = 0; i < 2; i++) {
	for (i = 0; i < hw->ports; i++) {
		struct net_device *dev = hw->dev[i];
		struct net_device *dev = hw->dev[i];


		if (dev) {
		if (dev) {
@@ -3460,7 +3460,7 @@ static int sky2_resume(struct pci_dev *pdev)
	if (err)
	if (err)
		goto out;
		goto out;


	for (i = 0; i < 2; i++) {
	for (i = 0; i < hw->ports; i++) {
		struct net_device *dev = hw->dev[i];
		struct net_device *dev = hw->dev[i];
		if (dev && netif_running(dev)) {
		if (dev && netif_running(dev)) {
			netif_device_attach(dev);
			netif_device_attach(dev);