[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 13:06:23 +0200
From: Nuno Sa <nuno.sa@...log.com>
To: Petr Mladek <pmladek@...e.com>, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Olivier Moysan
<olivier.moysan@...s.st.com>,
Jyoti Bhayana <jbhayana@...gle.com>,
Andy
Shevchenko <andriy.shevchenko@...ux.intel.com>,
Chris Down
<chris@...isdown.name>,
John Ogness <john.ogness@...utronix.de>,
Greg
Kroah-Hartman <gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>, <linux-iio@...r.kernel.org>
Subject: [PATCH 1/4] dev_printk: add new dev_errp_probe() helper
This is similar to dev_err_probe() but for cases where an ERR_PTR() is
to be returned simplifying patterns like:
dev_err_probe(dev, ret, ...);
return ERR_PTR(ret)
Signed-off-by: Nuno Sa <nuno.sa@...log.com>
---
include/linux/dev_printk.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/dev_printk.h b/include/linux/dev_printk.h
index ae80a303c216..790144f6f99c 100644
--- a/include/linux/dev_printk.h
+++ b/include/linux/dev_printk.h
@@ -277,4 +277,9 @@ do { \
__printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
+/* Simple helper for dev_err_probe() when ERR_PTR() is to be returned. */
+#define dev_errp_probe(dev, ___err, fmt, ...) ({ \
+ ERR_PTR(dev_err_probe(dev, ___err, fmt, ##__VA_ARGS__)); \
+})
+
#endif /* _DEVICE_PRINTK_H_ */
--
2.44.0
Powered by blists - more mailing lists