Page MenuHomeFreeBSD

D56435.id176032.diff
No OneTemporary

D56435.id176032.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -267,6 +267,30 @@
dev_dbg(dev, __VA_ARGS__); \
} while (0)
+static inline int
+dev_err_probe(const struct device *dev, int err, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+
+ /*
+ * On Linux, they look at the error code to determine if the message
+ * should be logged (not logged if -ENOMEM) and at which log level.
+ */
+ device_printf(dev->bsddev, fmt, args);
+
+ va_end(args);
+
+ return (err);
+}
+
+#define dev_err_ptr_probe(dev, err, fmt, ...) \
+ ERR_PTR(dev_err_probe((dev), (err), fmt, ##__VA_ARGS__)
+
+#define dev_err_cast_probe(dev, err, fmt, ...) \
+ ERR_PTR(dev_err_probe((dev), PTR_ERR(err), fmt, ##__VA_ARGS__)
+
/* Public and LinuxKPI internal devres functions. */
void *lkpi_devres_alloc(void(*release)(struct device *, void *), size_t, gfp_t);
void lkpi_devres_add(struct device *, void *);

File Metadata

Mime Type
text/plain
Expires
Thu, May 21, 7:13 AM (8 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31679733
Default Alt Text
D56435.id176032.diff (1 KB)

Event Timeline