diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-02-10 11:56:02 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-07 00:31:57 (GMT) |
commit | f43de77c9dddba86284f7cb58c5e257ebed843a3 (patch) | |
tree | a5a25b30840b81c0579413a5ccac27da9d04b43f | |
parent | 9ab81fb7a968c81d16fa00584487d7f1e7211887 (diff) | |
download | linux-f43de77c9dddba86284f7cb58c5e257ebed843a3.tar.xz |
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@vectorindia.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/panel/panel.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index 4da854c..322b73d 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -2377,23 +2377,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) |