arm: mach-k3: Enable dcache in SPL
[oweals/u-boot.git] / drivers / usb / gadget / usbstring.c
index 95555cf96b9c3a1f1b52482c54c5ae9830ae3a2a..83cdd8a2595e1c92aafbd5df6e404845abcf64f3 100644 (file)
@@ -1,17 +1,13 @@
+// SPDX-License-Identifier: LGPL-2.1+
 /*
  * Copyright (C) 2003 David Brownell
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * Ported to U-boot by: Thomas Smits <ts.smits@gmail.com> and
+ * Ported to U-Boot by: Thomas Smits <ts.smits@gmail.com> and
  *                      Remy Bohmer <linux@bohmer.net>
  */
 
 #include <common.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 
@@ -111,6 +107,9 @@ usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf)
        struct usb_string       *s;
        int                     len;
 
+       if (!table)
+               return -EINVAL;
+
        /* descriptor 0 has the language id */
        if (id == 0) {
                buf[0] = 4;