misc: panel: Remove always-true check from panel_detach()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 6 Feb 2017 14:38:08 +0000 (15:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Feb 2017 14:32:53 +0000 (15:32 +0100)
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>
drivers/misc/panel.c

index 8af500ecaaaf6634d4397e8632ac675a1f85f5fe..ed19b3e399b08d1f95ccaf31bd960611431e7c3f 100644 (file)
@@ -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 = {