aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2023-12-24 08:19:58 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2023-12-24 08:19:58 +0000
commita01259965319897b836019f1d4dcf1b5a5a6ea1a (patch)
tree26514626eaae3d57a324b980c6e44650f651cfb8
parentae1084ff01bf9d9a9a2c56caf6c7095f3e96f579 (diff)
downloadsrc-a01259965319897b836019f1d4dcf1b5a5a6ea1a.tar.gz
src-a01259965319897b836019f1d4dcf1b5a5a6ea1a.zip
LinuxKPI: Implement dev_dbg_once() macro
Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42795
-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 7a5d813063a9..142003c5ca8c 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -236,6 +236,14 @@ show_class_attr_string(struct class *class,
} \
} while (0)
+#define dev_dbg_once(dev, ...) do { \
+ static bool __dev_dbg_once; \
+ if (!__dev_dbg_once) { \
+ __dev_dbg_once = 1; \
+ dev_dbg(dev, __VA_ARGS__); \
+ } \
+} while (0)
+
#define dev_err_ratelimited(dev, ...) do { \
static linux_ratelimit_t __ratelimited; \
if (linux_ratelimited(&__ratelimited)) \