lkml.org 
[lkml]   [2015]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] staging: panel: register reboot
Date
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>
---
drivers/staging/panel/panel.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index f329e3f..3ef3dcf 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2206,6 +2206,7 @@ static void panel_attach(struct parport *port)
if (misc_register(&keypad_dev))
goto err_lcd_unreg;
}
+ register_reboot_notifier(&panel_notifier);
return;

err_lcd_unreg:
@@ -2227,6 +2228,8 @@ static void panel_detach(struct parport *port)
return;
}

+ unregister_reboot_notifier(&panel_notifier);
+
if (keypad.enabled && keypad_initialized) {
misc_deregister(&keypad_dev);
keypad_initialized = 0;
@@ -2293,7 +2296,6 @@ static int __init panel_init_module(void)
break;
}

-
/*
* Overwrite selection with module param values (both keypad and lcd),
* where the deprecated params have lower prio.
@@ -2363,8 +2365,6 @@ static int __init panel_init_module(void)
return -EIO;
}

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

static void __exit panel_cleanup_module(void)
{
- unregister_reboot_notifier(&panel_notifier);

if (scan_timer.function != NULL)
del_timer_sync(&scan_timer);
--
1.8.1.2


\
 
 \ /
  Last update: 2015-03-08 19:01    [W:0.069 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site