All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: arnd@arndb.de, gregkh@linuxfoundation.org, rafael@kernel.org,
	linus.walleij@linaro.org, mika.westerberg@linux.intel.com,
	andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com,
	jic23@kernel.org, przemyslaw.kitszel@intel.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v5 01/12] err.h: move IOMEM_ERR_PTR() to err.h
Date: Wed, 12 Feb 2025 11:55:02 +0530	[thread overview]
Message-ID: <20250212062513.2254767-2-raag.jadav@intel.com> (raw)
In-Reply-To: <20250212062513.2254767-1-raag.jadav@intel.com>

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>
---
 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


  reply	other threads:[~2025-02-12  6:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12  6:25 [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-12  6:25 ` Raag Jadav [this message]
2025-02-12  6:32   ` [PATCH v5 01/12] err.h: move IOMEM_ERR_PTR() to err.h Arnd Bergmann
2025-02-12  6:25 ` [PATCH v5 02/12] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-12  6:41   ` Arnd Bergmann
2025-02-12 11:00     ` Andy Shevchenko
2025-02-20 11:59   ` Greg KH
2025-02-20 12:18     ` Andy Shevchenko
2025-02-12  6:25 ` [PATCH v5 03/12] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
2025-02-12  6:25 ` [PATCH v5 04/12] devres: Introduce devm_kmemdup_array() Raag Jadav
2025-02-12  6:25 ` [PATCH v5 05/12] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
2025-02-12  6:25 ` [PATCH v5 06/12] pinctrl: baytrail: " Raag Jadav
2025-02-12  6:25 ` [PATCH v5 07/12] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
2025-02-12  6:25 ` [PATCH v5 08/12] pinctrl: tangier: " Raag Jadav
2025-02-12  6:25 ` [PATCH v5 09/12] pinctrl: pxa2xx: " Raag Jadav
2025-02-12  6:25 ` [PATCH v5 10/12] iio: adc: xilinx-xadc-core: " Raag Jadav
2025-02-16 16:59   ` Jonathan Cameron
2025-02-12  6:25 ` [PATCH v5 11/12] input: sparse-keymap: " Raag Jadav
2025-02-12  6:25 ` [PATCH v5 12/12] input: ipaq-micro-keys: " Raag Jadav
2025-02-12 11:05 ` [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Andy Shevchenko
2025-02-12 16:22   ` Raag Jadav
2025-02-12 17:21     ` Andy Shevchenko
2025-02-20 12:19       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250212062513.2254767-2-raag.jadav@intel.com \
    --to=raag.jadav@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.