Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2022 14:04:26 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a7727e1a6d5d - main - linuxkpi: Add dev_info_once
Message-ID:  <202208081404.278E4Qiv089012@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=a7727e1a6d5d6120d439af222f58345b4932100c

commit a7727e1a6d5d6120d439af222f58345b4932100c
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-08-02 08:22:59 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-08-08 13:22:36 +0000

    linuxkpi: Add dev_info_once
    
    Obtained from:  drm-kmod
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D36021
---
 sys/compat/linuxkpi/common/include/linux/device.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h
index e39b3f95ca0d..1c26cecfd955 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -193,6 +193,14 @@ show_class_attr_string(struct class *class,
 #define	dev_printk(lvl, dev, fmt, ...)					\
 	    device_printf((dev)->bsddev, fmt, ##__VA_ARGS__)
 
+#define dev_info_once(dev, ...) do {		\
+	static bool __dev_info_once;		\
+	if (!__dev_info_once) {			\
+	__dev_info_once = true;			\
+	dev_info(dev, __VA_ARGS__);		\
+	}					\
+} while (0)
+
 #define	dev_err_once(dev, ...) do {		\
 	static bool __dev_err_once;		\
 	if (!__dev_err_once) {			\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208081404.278E4Qiv089012>