Commit 0ea09dfe873657df47d83d5d4e0090bbf05c6abb
Committed by
Marek Vasut
1 parent
9b2393812e
Exists in
v2017.01-smarct4x
and in
37 other branches
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>
Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff
common/usb_kbd.c
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | * SPDX-License-Identifier: GPL-2.0+ |
9 | 9 | */ |
10 | 10 | #include <common.h> |
11 | +#include <errno.h> | |
11 | 12 | #include <malloc.h> |
12 | 13 | #include <stdio_dev.h> |
13 | 14 | #include <asm/byteorder.h> |
... | ... | @@ -559,7 +560,11 @@ |
559 | 560 | int usb_kbd_deregister(void) |
560 | 561 | { |
561 | 562 | #ifdef CONFIG_SYS_STDIO_DEREGISTER |
562 | - return stdio_deregister(DEVNAME); | |
563 | + int ret = stdio_deregister(DEVNAME); | |
564 | + if (ret && ret != -ENODEV) | |
565 | + return ret; | |
566 | + | |
567 | + return 0; | |
563 | 568 | #else |
564 | 569 | return 1; |
565 | 570 | #endif |