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/2] staging: panel: register driver after checking device
Date: Tue, 10 Feb 2015 17:26:02 +0530 [thread overview]
Message-ID: <1423569363-7354-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
register the driver only if lcd or keypad has been enabled and if
both are disabled then just exit.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/panel/panel.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 6ed35b6..df044b2 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2379,23 +2379,17 @@ static int __init panel_init_module(void)
/* tells various subsystems about the fact that we are initializing */
init_in_progress = 1;
- if (parport_register_driver(&panel_driver)) {
- pr_err("could not register with parport. Aborting.\n");
- return -EIO;
- }
-
if (!lcd.enabled && !keypad.enabled) {
- /* no device enabled, let's release the parport */
- if (pprt) {
- parport_release(pprt);
- parport_unregister_device(pprt);
- pprt = NULL;
- }
- parport_unregister_driver(&panel_driver);
+ /* no device enabled, let's exit */
pr_err("driver version " PANEL_VERSION " disabled.\n");
return -ENODEV;
}
+ if (parport_register_driver(&panel_driver)) {
+ pr_err("could not register with parport. Aborting.\n");
+ return -EIO;
+ }
+
register_reboot_notifier(&panel_notifier);
if (pprt)
--
1.8.1.2
next reply other threads:[~2015-02-10 11:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 11:56 Sudip Mukherjee [this message]
2015-02-10 11:56 ` [PATCH 2/2] staging: panel: initialize lcd if lcd enabled Sudip Mukherjee
2015-02-10 17:53 ` Willy Tarreau
2015-02-10 17:51 ` [PATCH 1/2] staging: panel: register driver after checking device 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=1423569363-7354-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 \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®