Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/freebsd-src.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2022-11-11 20:42:31 +0300
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2022-11-11 20:42:31 +0300
commitc4163160e44d1f329301b0fe943854b9dc0750dc (patch)
treefe807e8a660145d46f5540f7facfedb13637ccf4
parent23ebeac87f400e1c35b18392f968f6fa38ae128d (diff)
linuxkpi: Add `dev_warn_once()` in <linux/device.h>
Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D36968
-rw-r--r--sys/compat/linuxkpi/common/include/linux/device.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h
index f3e2c4697562..720a2019c0f0 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -206,6 +206,14 @@ show_class_attr_string(struct class *class,
} \
} while (0)
+#define dev_warn_once(dev, ...) do { \
+ static bool __dev_warn_once; \
+ if (!__dev_warn_once) { \
+ __dev_warn_once = 1; \
+ dev_warn(dev, __VA_ARGS__); \
+ } \
+} while (0)
+
#define dev_err_once(dev, ...) do { \
static bool __dev_err_once; \
if (!__dev_err_once) { \