summaryrefslogtreecommitdiff
path: root/include/linux/err.h
diff options
context:
space:
mode:
authorRaag Jadav <raag.jadav@intel.com>2025-02-12 11:55:02 +0530
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2025-02-24 12:08:51 +0200
commit18311a766c587fc69b1806f1d5943305903b7e6e (patch)
treea473b2fee9024056994f8b6febc8ae1d50312b0b /include/linux/err.h
parent2014c95afecee3e76ca4a56956a936e23283f05b (diff)
err.h: move IOMEM_ERR_PTR() to err.h
Since IOMEM_ERR_PTR() macro deals with an error pointer, a better place for it is err.h. This helps avoid dependency on io.h for the users that don't need it. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Raag Jadav <raag.jadav@intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/linux/err.h')
-rw-r--r--include/linux/err.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/err.h b/include/linux/err.h
index a4dacd745fcf..1d60aa86db53 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -44,6 +44,9 @@ static inline void * __must_check ERR_PTR(long error)
/* Return the pointer in the percpu address space. */
#define ERR_PTR_PCPU(error) ((void __percpu *)(unsigned long)ERR_PTR(error))
+/* Cast an error pointer to __iomem. */
+#define IOMEM_ERR_PTR(error) (__force void __iomem *)ERR_PTR(error)
+
/**
* PTR_ERR - Extract the error code from an error pointer.
* @ptr: An error pointer.