[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1423569363-7354-1-git-send-email-sudipm.mukherjee@gmail.com>
Date: Tue, 10 Feb 2015 17:26:02 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Willy Tarreau <willy@...a-x.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] staging: panel: register driver after checking device
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@...torindia.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists