summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2017-02-06 15:38:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-10 15:32:53 +0100
commit3f77b43965054c17fbc3111650c4e90f294a7bbe (patch)
tree4547d73551e38a7cddab21852e151a585b3b7b42 /drivers/misc
parent9db3cf1ccd5f78ad5c2a01a2fd5c5774d0ed0f6f (diff)
misc: panel: Remove always-true check from panel_detach()
panel_detach() already verified that pptr is a valid pointer. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/panel.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/misc/panel.c b/drivers/misc/panel.c
index 8af500ecaaaf..ed19b3e399b0 100644
--- a/drivers/misc/panel.c
+++ b/drivers/misc/panel.c
@@ -2266,24 +2266,22 @@ static void panel_detach(struct parport *port)
if (scan_timer.function)
del_timer_sync(&scan_timer);
- if (pprt) {
- if (keypad.enabled) {
- misc_deregister(&keypad_dev);
- keypad_initialized = 0;
- }
-
- if (lcd.enabled) {
- panel_lcd_print("\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-");
- misc_deregister(&lcd_dev);
- lcd.initialized = false;
- }
+ if (keypad.enabled) {
+ misc_deregister(&keypad_dev);
+ keypad_initialized = 0;
+ }
- /* TODO: free all input signals */
- parport_release(pprt);
- parport_unregister_device(pprt);
- pprt = NULL;
- unregister_reboot_notifier(&panel_notifier);
+ if (lcd.enabled) {
+ panel_lcd_print("\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-");
+ misc_deregister(&lcd_dev);
+ lcd.initialized = false;
}
+
+ /* TODO: free all input signals */
+ parport_release(pprt);
+ parport_unregister_device(pprt);
+ pprt = NULL;
+ unregister_reboot_notifier(&panel_notifier);
}
static struct parport_driver panel_driver = {