Kishon Vijay Abraham I | e23c920 | 2015-02-23 18:39:57 +0530 | [diff] [blame] | 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 | * |
Kishon Vijay Abraham I | e23c920 | 2015-02-23 18:39:57 +0530 | [diff] [blame] | 8 | * 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 I | 9c38ca4 | 2015-02-23 18:40:00 +0530 | [diff] [blame] | 17 | #define dev_WARN(dev, format, arg...) debug(format, ##arg) |
Kishon Vijay Abraham I | e23c920 | 2015-02-23 18:39:57 +0530 | [diff] [blame] | 18 | #define WARN_ON_ONCE(val) debug("Error %d\n", val) |
| 19 | |
| 20 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) |
| 21 | |
| 22 | static inline size_t strlcat(char *dest, const char *src, size_t n) |
| 23 | { |
| 24 | strcat(dest, src); |
| 25 | return strlen(dest) + strlen(src); |
| 26 | } |
| 27 | |
Kishon Vijay Abraham I | 99030d7 | 2015-02-23 18:40:02 +0530 | [diff] [blame^] | 28 | static inline void *devm_kzalloc(struct device *dev, unsigned int size, |
| 29 | unsigned int flags) |
| 30 | { |
| 31 | return kzalloc(size, flags); |
| 32 | } |
| 33 | |
| 34 | static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) |
| 35 | { |
| 36 | return kzalloc(n * size, flags); |
| 37 | } |
Kishon Vijay Abraham I | e23c920 | 2015-02-23 18:39:57 +0530 | [diff] [blame] | 38 | #endif |