Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72721
b: refs/heads/master
c: 2a6f4e4
h: refs/heads/master
i:
  72719: 1c00449
v: v3
  • Loading branch information
Jan-Bernd Themann authored and Jeff Garzik committed Oct 29, 2007
1 parent 7cfb216 commit f40b51f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f920c186be09718542dfa77f6ebe1814be7d35cb
refs/heads/master: 2a6f4e4983918b18fe5d3fb364afe33db7139870
2 changes: 1 addition & 1 deletion trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0079"
#define DRV_VERSION "EHEA_0080"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include <linux/if.h>
#include <linux/list.h>
#include <linux/if_ether.h>
#include <linux/notifier.h>
#include <linux/reboot.h>

#include <net/ip.h>

#include "ehea.h"
Expand Down Expand Up @@ -3295,6 +3298,20 @@ static int __devexit ehea_remove(struct of_device *dev)
return 0;
}

static int ehea_reboot_notifier(struct notifier_block *nb,
unsigned long action, void *unused)
{
if (action == SYS_RESTART) {
ehea_info("Reboot: freeing all eHEA resources");
ibmebus_unregister_driver(&ehea_driver);
}
return NOTIFY_DONE;
}

static struct notifier_block ehea_reboot_nb = {
.notifier_call = ehea_reboot_notifier,
};

static int check_module_parm(void)
{
int ret = 0;
Expand Down Expand Up @@ -3351,6 +3368,8 @@ int __init ehea_module_init(void)
if (ret)
goto out;

register_reboot_notifier(&ehea_reboot_nb);

ret = ibmebus_register_driver(&ehea_driver);
if (ret) {
ehea_error("failed registering eHEA device driver on ebus");
Expand All @@ -3362,6 +3381,7 @@ int __init ehea_module_init(void)
if (ret) {
ehea_error("failed to register capabilities attribute, ret=%d",
ret);
unregister_reboot_notifier(&ehea_reboot_nb);
ibmebus_unregister_driver(&ehea_driver);
goto out;
}
Expand All @@ -3375,6 +3395,7 @@ static void __exit ehea_module_exit(void)
flush_scheduled_work();
driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
ibmebus_unregister_driver(&ehea_driver);
unregister_reboot_notifier(&ehea_reboot_nb);
ehea_destroy_busmap();
}

Expand Down

0 comments on commit f40b51f

Please sign in to comment.