# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1326188636 -3600
# Node ID 4033d0d394ec14913f86935f7d63c9af379bd877
# Parent  80c03df98a491691d8967c5371dd7fa5e521c4ce
Fixed suspend/resume for r8169 drivers.

diff -r 80c03df98a49 -r 4033d0d394ec devices/r8169-2.6.24-ethercat.c
--- a/devices/r8169-2.6.24-ethercat.c	Tue Jan 10 10:43:36 2012 +0100
+++ b/devices/r8169-2.6.24-ethercat.c	Tue Jan 10 10:43:56 2012 +0100
@@ -3237,7 +3237,7 @@
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	if (tp->ecdev)
-		return;
+		return -EBUSY;
 
 	if (!netif_running(dev))
 		goto out_pci_suspend;
@@ -3269,7 +3269,7 @@
 	struct rtl8169_private *tp = netdev_priv(dev);
 
 	if (tp->ecdev)
-		return;
+		return -EBUSY;
 
 	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
diff -r 80c03df98a49 -r 4033d0d394ec devices/r8169-2.6.28-ethercat.c
--- a/devices/r8169-2.6.28-ethercat.c	Tue Jan 10 10:43:36 2012 +0100
+++ b/devices/r8169-2.6.28-ethercat.c	Tue Jan 10 10:43:56 2012 +0100
@@ -3858,7 +3858,7 @@
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	if (tp->ecdev)
-		return;
+		return -EBUSY;
 
 	if (!netif_running(dev))
 		goto out_pci_suspend;
@@ -3889,7 +3889,7 @@
 	struct rtl8169_private *tp = netdev_priv(dev);
 
 	if (tp->ecdev)
-		return;
+		return -EBUSY;
 
 	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
diff -r 80c03df98a49 -r 4033d0d394ec devices/r8169-2.6.37-ethercat.c
--- a/devices/r8169-2.6.37-ethercat.c	Tue Jan 10 10:43:36 2012 +0100
+++ b/devices/r8169-2.6.37-ethercat.c	Tue Jan 10 10:43:56 2012 +0100
@@ -4956,6 +4956,9 @@
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rtl8169_private *tp = netdev_priv(dev);
 
+	if (tp->ecdev)
+		return -EBUSY;
+
 	rtl8169_init_phy(dev, tp);
 
 	if (netif_running(dev))