LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Willy Tarreau <willy@meta-x.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] staging: panel: register reboot
Date: Sun,  8 Mar 2015 23:07:24 +0530	[thread overview]
Message-ID: <1425836246-15355-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)

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


             reply	other threads:[~2015-03-08 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08 17:37 Sudip Mukherjee [this message]
2015-03-08 17:37 ` [PATCH 2/3] staging: panel: return register value Sudip Mukherjee
2015-03-09  6:30   ` Willy Tarreau
2015-03-09 13:35     ` Sudip Mukherjee
2015-03-09 15:05       ` Willy Tarreau
2015-03-08 17:37 ` [PATCH 3/3] staging: panel: remove initialization check Sudip Mukherjee
2015-03-09  6:20   ` Willy Tarreau
2015-03-09  6:19 ` [PATCH 1/3] staging: panel: register reboot Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425836246-15355-1-git-send-email-sudipm.mukherjee@gmail.com \
    --to=sudipm.mukherjee@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@meta-x.org \
    --subject='Re: [PATCH 1/3] staging: panel: register reboot' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).