Patchwork [for,2.6.27?,07/10] ne.c: fix suspend and resume for ISA PnP cards

login
register
mail settings
Submitter Andrew Morton
Date Sept. 22, 2008, 9:10 p.m.
Message ID <200809222110.m8MLALvH029893@imap1.linux-foundation.org>
Download mbox | patch
Permalink /patch/947/
State Accepted
Delegated to: Jeff Garzik
Headers show

Comments

Andrew Morton - Sept. 22, 2008, 9:10 p.m.
From: David Fries <david@fries.net>

A call to pnp_stop_dev and pnp_start_dev now shuts down and initializes
plug and play devices for suspend and resume.

Signed-off-by: David Fries <david@fries.net>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/ne.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Patch

diff -puN drivers/net/ne.c~nec-fix-suspend-and-resume-for-isa-pnp-cards drivers/net/ne.c
--- a/drivers/net/ne.c~nec-fix-suspend-and-resume-for-isa-pnp-cards
+++ a/drivers/net/ne.c
@@ -895,8 +895,12 @@  static int ne_drv_suspend(struct platfor
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
-	if (netif_running(dev))
+	if (netif_running(dev)) {
+		struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
 		netif_device_detach(dev);
+		if (idev)
+			pnp_stop_dev(idev);
+	}
 	return 0;
 }
 
@@ -905,6 +909,9 @@  static int ne_drv_resume(struct platform
 	struct net_device *dev = platform_get_drvdata(pdev);
 
 	if (netif_running(dev)) {
+		struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+		if (idev)
+			pnp_start_dev(idev);
 		ne_reset_8390(dev);
 		NS8390p_init(dev, 1);
 		netif_device_attach(dev);