[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250212062513.2254767-2-raag.jadav@intel.com>
Date: Wed, 12 Feb 2025 11:55:02 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: arnd@...db.de,
gregkh@...uxfoundation.org,
rafael@...nel.org,
linus.walleij@...aro.org,
mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com,
dmitry.torokhov@...il.com,
jic23@...nel.org,
przemyslaw.kitszel@...el.com
Cc: linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org,
linux-iio@...r.kernel.org,
Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v5 01/12] 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@...ux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@...el.com>
---
include/linux/err.h | 3 +++
include/linux/io.h | 2 --
2 files changed, 3 insertions(+), 2 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.
diff --git a/include/linux/io.h b/include/linux/io.h
index 59ec5eea696c..40cb2de73f5e 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -65,8 +65,6 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
}
#endif
-#define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err)
-
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
resource_size_t size);
void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
--
2.34.1
Powered by blists - more mailing lists