]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: composite: Move bitmap related operations to ./include/linux/bitmap.h
authorLukasz Majewski <lukma@denx.de>
Fri, 23 Nov 2018 16:36:19 +0000 (17:36 +0100)
committerMarek Vasut <marex@denx.de>
Fri, 14 Dec 2018 16:59:08 +0000 (17:59 +0100)
The BITMAP related operations can now be moved to ./include/linux/bitmap.h
file to mimic the Linux kernel directory tree.

This change also allows to remove the lin_gadget_compat.h header file
(which is a legacy code only for composite U-boot layer).
It was also possible to remove #includes from several USB gadget drivers.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
14 files changed:
drivers/usb/dwc3/gadget.c
drivers/usb/dwc3/ti_usb_phy.c
drivers/usb/eth/r8152.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/gadget/dwc2_udc_otg.c
drivers/usb/gadget/dwc2_udc_otg_phy.c
drivers/usb/gadget/dwc2_udc_otg_priv.h
drivers/usb/gadget/f_mass_storage.c
drivers/usb/gadget/pxa25x_udc.c
include/linux/bitmap.h [new file with mode: 0644]
include/linux/types.h
include/linux/usb/composite.h
include/usb/lin_gadget_compat.h [deleted file]

index e340cb268fcdbff83f36af322fd0d23d434d4c5c..085f7b8968842bbdae3f08ac543b3b72ba96afda 100644 (file)
@@ -16,7 +16,6 @@
 #include <common.h>
 #include <malloc.h>
 #include <asm/dma-mapping.h>
-#include <usb/lin_gadget_compat.h>
 #include <linux/bug.h>
 #include <linux/list.h>
 
index d168e868e35ea98e2a948fcc3ce501876141a597..e7ea12c163a85b9df61ce0b7924e5656d52b0243 100644 (file)
@@ -19,7 +19,6 @@
 #include <common.h>
 #include <malloc.h>
 #include <ti-usb-phy-uboot.h>
-#include <usb/lin_gadget_compat.h>
 #include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
index 941158abdd315d5cf29110fbb7b1ea31ce389195..e5f73e3d4c0af4743c16c12e8ae27b187830e457 100644 (file)
@@ -10,7 +10,6 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <usb.h>
-#include <usb/lin_gadget_compat.h>
 #include <linux/mii.h>
 #include <linux/bitops.h>
 #include "usb_ether.h"
index 39ea87005cbc0d03e1571ef2eb5c15e2e0fff5a4..2a6626b44318bac582e7b7a1040f00bd57f1a7ee 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/usb/gadget.h>
 #include <linux/usb/at91_udc.h>
 #include <malloc.h>
-#include <usb/lin_gadget_compat.h>
 
 #include "at91_udc.h"
 
index c9d483318fe8aade5429ac9560697fcc7cf597a4..dffa5117f9c94d391cd5a84680f1d5cb4842b6d7 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/usb/gadget.h>
 #include <linux/usb/atmel_usba_udc.h>
 #include <malloc.h>
-#include <usb/lin_gadget_compat.h>
 
 #include "atmel_usba_udc.h"
 
index e3edd10e29c038a65dc855d9a652b29624e6e48f..3c7ad033e3f799ae1a085c7bb7e15f60cef355f6 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "dwc2_udc_otg_regs.h"
 #include "dwc2_udc_otg_priv.h"
-#include <usb/lin_gadget_compat.h>
 
 /***********************************************************/
 
index 47aa78ae947acaf5c4cfc798571a99e297bfd2df..c4338af0d733b0cb2645c7ce634b6f360797b37a 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "dwc2_udc_otg_regs.h"
 #include "dwc2_udc_otg_priv.h"
-#include <usb/lin_gadget_compat.h>
 
 #include <usb/dwc2_udc.h>
 
index b64e222b6d7e028a50119fee20de1740902fdda3..aaa90187fb765b49061ea2764589bdeda8415cd6 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/list.h>
-#include <usb/lin_gadget_compat.h>
 #include <usb/dwc2_udc.h>
 
 /*-------------------------------------------------------------------------*/
index a3101afa0df370319b9d8625586ea35d395c80c1..45c7b58eed43f4cd385a790dc20c7935340437b9 100644 (file)
 #include <linux/usb/gadget.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/composite.h>
-#include <usb/lin_gadget_compat.h>
+#include <linux/bitmap.h>
 #include <g_dnl.h>
 
 /*------------------------------------------------------------------------*/
index 44092df25baa0f3f9dc0cba5f5bc47b7d5b578e7..09c0a30b2ba029044da8a571535e4830aac6acf1 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-#include <usb/lin_gadget_compat.h>
 #include <asm/arch/pxa-regs.h>
 
 #include "pxa25x_udc.h"
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
new file mode 100644 (file)
index 0000000..4a54ae0
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+#ifndef __LINUX_BITMAP_H
+#define __LINUX_BITMAP_H
+
+#include <asm/types.h>
+#include <linux/types.h>
+#include <linux/bitops.h>
+
+#define small_const_nbits(nbits) \
+       (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
+
+static inline void bitmap_zero(unsigned long *dst, int nbits)
+{
+       if (small_const_nbits(nbits)) {
+               *dst = 0UL;
+       } else {
+               int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
+
+               memset(dst, 0, len);
+       }
+}
+
+#endif /* __LINUX_BITMAP_H */
index 1f3cd63b8f2265545b8d6bd245b957741b3fb8fa..cc6f7cb39ee71b1889117057ade433895396242c 100644 (file)
@@ -158,4 +158,7 @@ struct ustat {
        char                    f_fpack[6];
 };
 
+#define DECLARE_BITMAP(name, bits) \
+       unsigned long name[BITS_TO_LONGS(bits)]
+
 #endif /* _LINUX_TYPES_H */
index 30c464ce39d040f2454bd353931c65a349e06365..a49a66f2f82c7e377bf7c2144d1255fef4cc5afb 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-#include <usb/lin_gadget_compat.h>
+#include <linux/bitmap.h>
 
 /*
  * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h
deleted file mode 100644 (file)
index e5dba47..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2011 Samsung Electronics
- * Lukasz Majewski <l.majewski@samsung.com>
- *
- * This is a Linux kernel compatibility layer for USB Gadget
- */
-
-#ifndef __LIN_COMPAT_H__
-#define __LIN_COMPAT_H__
-
-#include <linux/bitops.h>
-#include <linux/compat.h>
-
-/* common */
-#define DECLARE_BITMAP(name, bits) \
-       unsigned long name[BITS_TO_LONGS(bits)]
-
-#define small_const_nbits(nbits) \
-       (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
-
-static inline void bitmap_zero(unsigned long *dst, int nbits)
-{
-       if (small_const_nbits(nbits))
-               *dst = 0UL;
-       else {
-               int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
-               memset(dst, 0, len);
-       }
-}
-
-#define dma_cache_maint(addr, size, mode) cache_flush()
-void cache_flush(void);
-
-#endif /* __LIN_COMPAT_H__ */