[PATCH 2/2] ne.c Fix suspend and resume for ISA PnP cards.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Fries
Date: Saturday, September 13, 2008 - 9:54 am

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>
---
This version is the same as the last PATCH 2/2, only with updated line
offsets.

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

diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 4cb9c11..f9da162 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -895,8 +895,12 @@ static int ne_drv_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	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_device *pdev)
 	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);
-- 
1.4.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] ne.c fix for hibernate and rmmod oops fix, David Fries, (Wed Sep 3, 8:02 pm)
Re: [PATCH] ne.c fix for hibernate and rmmod oops fix, Jeff Garzik, (Thu Sep 4, 12:48 am)
Re: [PATCH] ne.c fix for hibernate and rmmod oops fix, Paul Gortmaker, (Fri Sep 5, 1:01 am)
Re: [PATCH] ne.c fix for hibernate and rmmod oops fix, Atsushi Nemoto, (Thu Sep 11, 6:50 am)
[PATCH 2/2] ne.c Fix suspend and resume for ISA PnP cards., David Fries, (Sat Sep 13, 9:54 am)