Skip to content

Commit bb046fe

Browse files
sudipm-mukherjeegregkh
authored andcommitted
staging: panel: register reboot
we donot need the reboot notifier in module init section, as the notifier is used after lcd is initialized. so lets register for the reboot notifier only after we have successfully attached to the parallel port. and similarly unregister at detach. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent de99bef commit bb046fe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/staging/panel/panel.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,7 @@ static void panel_attach(struct parport *port)
22342234
if (misc_register(&keypad_dev))
22352235
goto err_lcd_unreg;
22362236
}
2237+
register_reboot_notifier(&panel_notifier);
22372238
return;
22382239

22392240
err_lcd_unreg:
@@ -2255,6 +2256,8 @@ static void panel_detach(struct parport *port)
22552256
return;
22562257
}
22572258

2259+
unregister_reboot_notifier(&panel_notifier);
2260+
22582261
if (keypad.enabled && keypad_initialized) {
22592262
misc_deregister(&keypad_dev);
22602263
keypad_initialized = 0;
@@ -2321,7 +2324,6 @@ static int __init panel_init_module(void)
23212324
break;
23222325
}
23232326

2324-
23252327
/*
23262328
* Overwrite selection with module param values (both keypad and lcd),
23272329
* where the deprecated params have lower prio.
@@ -2391,8 +2393,6 @@ static int __init panel_init_module(void)
23912393
return -EIO;
23922394
}
23932395

2394-
register_reboot_notifier(&panel_notifier);
2395-
23962396
if (pprt)
23972397
pr_info("driver version " PANEL_VERSION
23982398
" registered on parport%d (io=0x%lx).\n", parport,
@@ -2408,7 +2408,6 @@ static int __init panel_init_module(void)
24082408

24092409
static void __exit panel_cleanup_module(void)
24102410
{
2411-
unregister_reboot_notifier(&panel_notifier);
24122411

24132412
if (scan_timer.function != NULL)
24142413
del_timer_sync(&scan_timer);

0 commit comments

Comments
 (0)