usb: dwc3: remove linux-compat header file
Subsystems (6)
PATCH 1/1 usb: dwc3: remove linux-compat header file
Removed linux compatibility header file that was added specifically for dwc3. The macro definitions and other functions added in this header file has been moved to more generic linux compatibility header file thats used across u-boot.
Found an issue w.r.t duplicate definition in mtd.h so fixed it here.
Signed-off-by Kishon Vijay Abraham I <[email protected]>
---
Compile tested only with a few configs. Since I'm adding defintions to linux/compat.h it requires more testing with all the configs.
drivers/usb/dwc3/core.c | 3 --- drivers/usb/dwc3/dwc3-omap.c | 3 --- drivers/usb/dwc3/ep0.c | 2 -- drivers/usb/dwc3/gadget.c | 2 -- drivers/usb/dwc3/linux-compat.h | 38 ----------------------------------- drivers/usb/dwc3/ti_usb_phy.c | 2 -- drivers/usb/musb-new/linux-compat.h | 6 ------ include/linux/compat.h | 15 ++++++++++++++ include/linux/mtd/mtd.h | 2 -- include/linux/string.h | 1 + lib/linux_compat.c | 6 ++++++ lib/string.c | 6 ++++++ 12 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 drivers/usb/dwc3/linux-compat.h
drivers/usb/dwc3/core.c +0 -3
@@ -27,8 +27,6 @@#include "gadget.h" #include "io.h" -#include "linux-compat.h" -static LIST_HEAD (dwc3_list);/* -------------------------------------------------------------------------- */
@@ -613,7 +611,6 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)int dwc3_uboot_init (struct dwc3_device *dwc3_dev) {struct dwc3 *dwc; -struct device *dev;u8 lpm_nyet_threshold;u8 tx_de_emphasis;u8 hird_threshold;
drivers/usb/dwc3/dwc3-omap.c +0 -3
@@ -24,8 +24,6 @@#include <linux/usb/otg.h> #include <linux/compat.h> -#include "linux-compat.h" -/* * All these registers belong to OMAP's Wrapper around the * DesignWare USB3 Core.
@@ -364,7 +362,6 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap, int utmi_mode)int dwc3_omap_uboot_init (struct dwc3_omap_device *omap_dev) {u32 reg; -struct device *dev;struct dwc3_omap *omap; omap =devm_kzalloc (dev,sizeof (*omap),GFP_KERNEL );
drivers/usb/dwc3/ep0.c +0 -2
@@ -25,8 +25,6 @@#include "gadget.h" #include "io.h" -#include "linux-compat.h" -static void __dwc3_ep0_do_control_status (struct dwc3 *dwc,struct dwc3_ep *dep);static void __dwc3_ep0_do_control_data (struct dwc3 *dwc,struct dwc3_ep *dep,struct dwc3_request *req);
drivers/usb/dwc3/gadget.c +0 -2
@@ -28,8 +28,6 @@#include "gadget.h" #include "io.h" -#include "linux-compat.h" -/** * dwc3_gadget_set_test_mode - Enables USB2 Test Modes * @dwc: pointer to our context structure
drivers/usb/dwc3/linux-compat.h deleted +0 -38
@@ -1,38 +0,0 @@ -/** -* linux-compat.h - DesignWare USB3 Linux Compatibiltiy Adapter Header -* -* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com -* -* Authors: Kishon Vijay Abraham I <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0 -* -*/ - -#ifndef __DWC3_LINUX_COMPAT__ -#define __DWC3_LINUX_COMPAT__ - -#define pr_debug (format) debug(format) -#define WARN(val, format, arg...) debug(format, ##arg) -#define dev_WARN(dev, format, arg...) debug(format, ##arg) -#define WARN_ON_ONCE (val) debug("Error %d\n", val) - -#define BUILD_BUG_ON_NOT_POWER_OF_2 (n) - -static inline size_t strlcat (char *dest,const char *src,size_t n) -{ -strcat (dest, src); -return strlen (dest) +strlen (src); -} - -static inline void *devm_kzalloc (struct device *dev,unsigned int size, -unsigned int flags) -{ -return kzalloc (size, flags); -} - -static inline void *kmalloc_array (size_t n,size_t size,gfp_t flags) -{ -return kzalloc (n * size, flags); -} -#endif
drivers/usb/dwc3/ti_usb_phy.c +0 -2
@@ -25,8 +25,6 @@#include <asm/io.h> #include <asm/arch/sys_proto.h> -#include "linux-compat.h" -#define PLL_STATUS 0x00000004#define PLL_GO 0x00000008#define PLL_CONFIGURATION1 0x0000000C
drivers/usb/musb-new/linux-compat.h +0 -6
@@ -7,12 +7,6 @@ #define pr_debug(fmt, args...) debug(fmt, ##args) -#define WARN(condition, fmt, args...) ({ \ - int ret_warn = !!condition; \ - if (ret_warn) \ - printf(fmt, ##args); \ - ret_warn; }) -#define writesl (a, d, s) __raw_writesl((unsigned long)a, d, s)#define readsl (a, d, s) __raw_readsl((unsigned long)a, d, s)#define writesw (a, d, s) __raw_writesw((unsigned long)a, d, s)
include/linux/compat.h +15 -0
@@ -27,6 +27,18 @@ extern struct p_current *current;#define printk printf#define printk_once printf +#define pr_debug(fmt, args...) debug(fmt, ##args) + +#define WARN(condition, fmt, args...) ({ \ + int ret_warn = !!condition; \ + if (ret_warn) \ + printf(fmt, ##args); \ + ret_warn; }) +#define dev_WARN(dev, format, arg...) debug(format, ##arg) +#define WARN_ON_ONCE (val) debug("Error %d\n", val) + +#define BUILD_BUG_ON_NOT_POWER_OF_2 (n) +#define KERN_EMERG #define KERN_ALERT #define KERN_CRIT
@@ -38,11 +50,14 @@ extern struct p_current *current;void *kmalloc (size_t size,int flags);void *kzalloc (size_t size,int flags); +void *kmalloc_array (size_t n,size_t size,int flags);#define vmalloc (size) kmalloc(size, 0)#define __vmalloc (size, flags, pgsz) kmalloc(size, flags)#define kfree (ptr) free(ptr)#define vfree (ptr) free(ptr) +#define devm_kzalloc (dev, size, flags) kzalloc(size, flags) +struct kmem_cache {int sz; };struct kmem_cache *get_mem (int element_sz);
include/linux/mtd/mtd.h +0 -2
@@ -442,14 +442,12 @@ static inline void mtd_erase_callback(struct erase_info *instr)#define MTD_DEBUG_LEVEL3 (3)/* Noisy */ #ifdef CONFIG_MTD_DEBUG -#define pr_debug(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) #define MTDDEBUG(n, args...) \ do { \ if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ printk(KERN_INFO args); \ } while(0)#else /* CONFIG_MTD_DEBUG */ -#define pr_debug(args...) #define MTDDEBUG(n, args...) \ do { \ if (0) \
include/linux/string.h +1 -0
@@ -35,6 +35,7 @@ size_t strlcpy(char *, const char *, size_t);#endif #ifndef __HAVE_ARCH_STRCATextern char *strcat (char *,const char *); +extern size_t strlcat (char *dest,const char *src,size_t n);#endif #ifndef __HAVE_ARCH_STRNCATextern char *strncat (char *,const char *,__kernel_size_t );
lib/linux_compat.c +6 -0
@@ -45,3 +45,9 @@ void *kmem_cache_alloc(struct kmem_cache *obj, int flag) {return memalign (ARCH_DMA_MINALIGN , obj->sz); } + +void *kmalloc_array (size_t n,size_t size,int flags) +{ +return kzalloc (n * size, flags); +} +
lib/string.c +6 -0
@@ -144,6 +144,12 @@ char * strcat(char * dest, const char * src) return tmp; } + +size_t strlcat (char *dest,const char *src,size_t n) +{ +strcat (dest, src); +return strlen (dest) +strlen (src); +}#endif #ifndef __HAVE_ARCH_STRNCAT
Signature · 1 line
1.7.9.5