From: Hans de Goede Date: Sat, 20 Sep 2014 14:54:34 +0000 (+0200) Subject: usb: kbd: Do not treat -ENODEV as an error for usb_kbd_deregister X-Git-Tag: v2014.10-rc3~1^2~15 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ea09dfe873657df47d83d5d4e0090bbf05c6abb;p=u-boot usb: kbd: Do not treat -ENODEV as an error for usb_kbd_deregister ENODEV menas no usb keyboard was registered, threat this as a successful usb_kbd_deregister. Signed-off-by: Hans de Goede --- diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 87f4125a9f..4c17b0d8ec 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -8,6 +8,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ #include +#include #include #include #include @@ -559,7 +560,11 @@ int drv_usb_kbd_init(void) int usb_kbd_deregister(void) { #ifdef CONFIG_SYS_STDIO_DEREGISTER - return stdio_deregister(DEVNAME); + int ret = stdio_deregister(DEVNAME); + if (ret && ret != -ENODEV) + return ret; + + return 0; #else return 1; #endif