xref: /openbmc/u-boot/drivers/usb/dwc3/linux-compat.h (revision 9b643e312d528f291966c1f30b0d90bf3b1d43dc)
1 /**
2  * linux-compat.h - DesignWare USB3 Linux Compatibiltiy Adapter  Header
3  *
4  * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
5  *
6  * Authors: Kishon Vijay Abraham I <kishon@ti.com>
7  *
8  * SPDX-License-Identifier:	GPL-2.0
9  *
10  */
11 
12 #ifndef __DWC3_LINUX_COMPAT__
13 #define __DWC3_LINUX_COMPAT__
14 
15 #define WARN(val, format, arg...)	debug(format, ##arg)
16 #define dev_WARN(dev, format, arg...)	debug(format, ##arg)
17 #define WARN_ON_ONCE(val)		debug("Error %d\n", val)
18 
19 static inline size_t strlcat(char *dest, const char *src, size_t n)
20 {
21 	strcat(dest, src);
22 	return strlen(dest) + strlen(src);
23 }
24 
25 static inline void *devm_kzalloc(struct device *dev, unsigned int size,
26 				 unsigned int flags)
27 {
28 	return kzalloc(size, flags);
29 }
30 #endif
31