Skip to content

Commit

Permalink
[PATCH] e1000: no need for reboot notifier
Browse files Browse the repository at this point in the history
sys_reboot() now calls device_suspend(), so it is no longer necessary for
the e1000 driver to register a reboot notifier [in fact doing so results in
e1000_suspend() getting called twice].

(akpm: we need to fast-track this.  It's causing ia64 to oops on shutdown)

Signed-off-by: Tony Luck <tony.luck@intel.com>
Cc: <cramerj@intel.com>
Cc: <john.ronciak@intel.com>
Cc: <ganesh.venkatesan@intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
aegl authored and Linus Torvalds committed Jul 28, 2005
1 parent f5c1d5b commit 8b378de
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
static void e1000_restore_vlan(struct e1000_adapter *adapter);

static int e1000_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
#ifdef CONFIG_PM
static int e1000_resume(struct pci_dev *pdev);
Expand All @@ -173,12 +172,6 @@ static int e1000_resume(struct pci_dev *pdev);
static void e1000_netpoll (struct net_device *netdev);
#endif

struct notifier_block e1000_notifier_reboot = {
.notifier_call = e1000_notify_reboot,
.next = NULL,
.priority = 0
};

/* Exported from other modules */

extern void e1000_check_options(struct e1000_adapter *adapter);
Expand Down Expand Up @@ -221,9 +214,7 @@ e1000_init_module(void)
printk(KERN_INFO "%s\n", e1000_copyright);

ret = pci_module_init(&e1000_driver);
if(ret >= 0) {
register_reboot_notifier(&e1000_notifier_reboot);
}

return ret;
}

Expand All @@ -239,7 +230,6 @@ module_init(e1000_init_module);
static void __exit
e1000_exit_module(void)
{
unregister_reboot_notifier(&e1000_notifier_reboot);
pci_unregister_driver(&e1000_driver);
}

Expand Down Expand Up @@ -3651,23 +3641,6 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
return 0;
}

static int
e1000_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
{
struct pci_dev *pdev = NULL;

switch(event) {
case SYS_DOWN:
case SYS_HALT:
case SYS_POWER_OFF:
while((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
if(pci_dev_driver(pdev) == &e1000_driver)
e1000_suspend(pdev, 3);
}
}
return NOTIFY_DONE;
}

static int
e1000_suspend(struct pci_dev *pdev, uint32_t state)
{
Expand Down

0 comments on commit 8b378de

Please sign in to comment.