]> git.sur5r.net Git - u-boot/blobdiff - common/usb_kbd.c
libfdt: fix build with Python 3
[u-boot] / common / usb_kbd.c
index cbb1995de3398431878811f92f6e79551b947965..d2d29cc98f5ed3e8cf7f91f13daa2d6619756df5 100644 (file)
@@ -199,7 +199,7 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, unsigned char scancode,
                }
        }
 
-       if ((scancode > 0x1d) && (scancode < 0x3a)) {
+       if ((scancode > 0x1d) && (scancode < 0x39)) {
                /* Shift pressed */
                if (modifier & (LEFT_SHIFT | RIGHT_SHIFT))
                        keycode = usb_kbd_numkey_shifted[scancode - 0x1e];
@@ -516,7 +516,7 @@ static int probe_usb_keyboard(struct usb_device *dev)
                return error;
 
        stdinname = getenv("stdin");
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
        error = iomux_doenv(stdin, stdinname);
        if (error)
                return error;
@@ -566,12 +566,11 @@ int drv_usb_kbd_init(void)
        /* No USB Keyboard found */
        return -1;
 }
-#endif
 
 /* Deregister the keyboard. */
 int usb_kbd_deregister(int force)
 {
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
        struct stdio_dev *dev;
        struct usb_device *usb_kbd_dev;
        struct usb_kbd_pdata *data;
@@ -582,7 +581,7 @@ int usb_kbd_deregister(int force)
                data = usb_kbd_dev->privptr;
                if (stdio_deregister_dev(dev, force) != 0)
                        return 1;
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
                if (iomux_doenv(stdin, getenv("stdin")) != 0)
                        return 1;
 #endif
@@ -599,16 +598,15 @@ int usb_kbd_deregister(int force)
 #endif
 }
 
+#endif
+
 #ifdef CONFIG_DM_USB
 
 static int usb_kbd_probe(struct udevice *dev)
 {
        struct usb_device *udev = dev_get_parent_priv(dev);
-       int ret;
-
-       ret = probe_usb_keyboard(udev);
 
-       return ret;
+       return probe_usb_keyboard(udev);
 }
 
 static int usb_kbd_remove(struct udevice *dev)
@@ -628,7 +626,7 @@ static int usb_kbd_remove(struct udevice *dev)
                ret = -EPERM;
                goto err;
        }
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
        if (iomux_doenv(stdin, getenv("stdin"))) {
                ret = -ENOLINK;
                goto err;