blob: 9e944a31be11f4edaccbfc857c493e3808ee3c53 [file] [log] [blame]
Kishon Vijay Abraham I18be4cb2015-02-23 18:39:57 +05301/**
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 *
Kishon Vijay Abraham I18be4cb2015-02-23 18:39:57 +05308 * SPDX-License-Identifier: GPL-2.0
9 *
10 */
11
12#ifndef __DWC3_LINUX_COMPAT__
13#define __DWC3_LINUX_COMPAT__
14
15#define pr_debug(format) debug(format)
16#define WARN(val, format, arg...) debug(format, ##arg)
Kishon Vijay Abraham Ib6d959a2015-02-23 18:40:00 +053017#define dev_WARN(dev, format, arg...) debug(format, ##arg)
Kishon Vijay Abraham I18be4cb2015-02-23 18:39:57 +053018#define WARN_ON_ONCE(val) debug("Error %d\n", val)
19
Kishon Vijay Abraham I18be4cb2015-02-23 18:39:57 +053020static inline size_t strlcat(char *dest, const char *src, size_t n)
21{
22 strcat(dest, src);
23 return strlen(dest) + strlen(src);
24}
25
Kishon Vijay Abraham I71744d02015-02-23 18:40:02 +053026static inline void *devm_kzalloc(struct device *dev, unsigned int size,
27 unsigned int flags)
28{
29 return kzalloc(size, flags);
30}
Kishon Vijay Abraham I18be4cb2015-02-23 18:39:57 +053031#endif