diff options
-rw-r--r-- | drivers/net/ehea/ehea.h | 2 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 4b4b74e47a67..f78e5bf7cb33 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0079" | 43 | #define DRV_VERSION "EHEA_0080" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 0a7e78925540..f0319f1e8e05 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -33,6 +33,9 @@ | |||
33 | #include <linux/if.h> | 33 | #include <linux/if.h> |
34 | #include <linux/list.h> | 34 | #include <linux/list.h> |
35 | #include <linux/if_ether.h> | 35 | #include <linux/if_ether.h> |
36 | #include <linux/notifier.h> | ||
37 | #include <linux/reboot.h> | ||
38 | |||
36 | #include <net/ip.h> | 39 | #include <net/ip.h> |
37 | 40 | ||
38 | #include "ehea.h" | 41 | #include "ehea.h" |
@@ -3295,6 +3298,20 @@ static int __devexit ehea_remove(struct of_device *dev) | |||
3295 | return 0; | 3298 | return 0; |
3296 | } | 3299 | } |
3297 | 3300 | ||
3301 | static int ehea_reboot_notifier(struct notifier_block *nb, | ||
3302 | unsigned long action, void *unused) | ||
3303 | { | ||
3304 | if (action == SYS_RESTART) { | ||
3305 | ehea_info("Reboot: freeing all eHEA resources"); | ||
3306 | ibmebus_unregister_driver(&ehea_driver); | ||
3307 | } | ||
3308 | return NOTIFY_DONE; | ||
3309 | } | ||
3310 | |||
3311 | static struct notifier_block ehea_reboot_nb = { | ||
3312 | .notifier_call = ehea_reboot_notifier, | ||
3313 | }; | ||
3314 | |||
3298 | static int check_module_parm(void) | 3315 | static int check_module_parm(void) |
3299 | { | 3316 | { |
3300 | int ret = 0; | 3317 | int ret = 0; |
@@ -3351,6 +3368,8 @@ int __init ehea_module_init(void) | |||
3351 | if (ret) | 3368 | if (ret) |
3352 | goto out; | 3369 | goto out; |
3353 | 3370 | ||
3371 | register_reboot_notifier(&ehea_reboot_nb); | ||
3372 | |||
3354 | ret = ibmebus_register_driver(&ehea_driver); | 3373 | ret = ibmebus_register_driver(&ehea_driver); |
3355 | if (ret) { | 3374 | if (ret) { |
3356 | ehea_error("failed registering eHEA device driver on ebus"); | 3375 | ehea_error("failed registering eHEA device driver on ebus"); |
@@ -3362,6 +3381,7 @@ int __init ehea_module_init(void) | |||
3362 | if (ret) { | 3381 | if (ret) { |
3363 | ehea_error("failed to register capabilities attribute, ret=%d", | 3382 | ehea_error("failed to register capabilities attribute, ret=%d", |
3364 | ret); | 3383 | ret); |
3384 | unregister_reboot_notifier(&ehea_reboot_nb); | ||
3365 | ibmebus_unregister_driver(&ehea_driver); | 3385 | ibmebus_unregister_driver(&ehea_driver); |
3366 | goto out; | 3386 | goto out; |
3367 | } | 3387 | } |
@@ -3375,6 +3395,7 @@ static void __exit ehea_module_exit(void) | |||
3375 | flush_scheduled_work(); | 3395 | flush_scheduled_work(); |
3376 | driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); | 3396 | driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); |
3377 | ibmebus_unregister_driver(&ehea_driver); | 3397 | ibmebus_unregister_driver(&ehea_driver); |
3398 | unregister_reboot_notifier(&ehea_reboot_nb); | ||
3378 | ehea_destroy_busmap(); | 3399 | ehea_destroy_busmap(); |
3379 | } | 3400 | } |
3380 | 3401 | ||