summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-20 16:54:34 +0200
committerMarek Vasut <marex@denx.de>2014-10-06 14:50:42 +0200
commit0ea09dfe873657df47d83d5d4e0090bbf05c6abb (patch)
tree8263d4352cfb42072c03a07377564b4ee1a3f85c
parent9b2393812e2b844919ac601b893e6210d5eb6e2c (diff)
downloadu-boot-imx-0ea09dfe873657df47d83d5d4e0090bbf05c6abb.zip
u-boot-imx-0ea09dfe873657df47d83d5d4e0090bbf05c6abb.tar.gz
u-boot-imx-0ea09dfe873657df47d83d5d4e0090bbf05c6abb.tar.bz2
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 <hdegoede@redhat.com>
-rw-r--r--common/usb_kbd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 87f4125..4c17b0d 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -8,6 +8,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <errno.h>
#include <malloc.h>
#include <stdio_dev.h>
#include <asm/byteorder.h>
@@ -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