devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rob Herring (Arm)" <robh@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Saravana Kannan <saravanak@google.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	 devicetree@vger.kernel.org
Subject: [PATCH 2/7] logic_pio: Constify fwnode_handle
Date: Thu, 10 Oct 2024 11:27:15 -0500	[thread overview]
Message-ID: <20241010-dt-const-v1-2-87a51f558425@kernel.org> (raw)
In-Reply-To: <20241010-dt-const-v1-0-87a51f558425@kernel.org>

The fwnode_handle passed into find_io_range_by_fwnode() and
logic_pio_trans_hwaddr() are not modified, so make them const.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
Please ack and I'll take with the rest of the series.
---
 include/linux/logic_pio.h | 6 +++---
 lib/logic_pio.c           | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h
index babf4e3c28ba..8f1a9408302f 100644
--- a/include/linux/logic_pio.h
+++ b/include/linux/logic_pio.h
@@ -17,7 +17,7 @@ enum {
 
 struct logic_pio_hwaddr {
 	struct list_head list;
-	struct fwnode_handle *fwnode;
+	const struct fwnode_handle *fwnode;
 	resource_size_t hw_start;
 	resource_size_t io_start;
 	resource_size_t size; /* range size populated */
@@ -110,8 +110,8 @@ void logic_outsl(unsigned long addr, const void *buffer, unsigned int count);
 #endif /* CONFIG_INDIRECT_PIO */
 #define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
 
-struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
-unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
+struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode);
+unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
 			resource_size_t hw_addr, resource_size_t size);
 int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
 void logic_pio_unregister_range(struct logic_pio_hwaddr *range);
diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index 2ea564a40064..e29496a38d06 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -122,7 +122,7 @@ void logic_pio_unregister_range(struct logic_pio_hwaddr *range)
  *
  * Traverse the io_range_list to find the registered node for @fwnode.
  */
-struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode)
+struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode)
 {
 	struct logic_pio_hwaddr *range, *found_range = NULL;
 
@@ -186,7 +186,7 @@ resource_size_t logic_pio_to_hwaddr(unsigned long pio)
  *
  * Returns Logical PIO value if successful, ~0UL otherwise
  */
-unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
+unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
 				     resource_size_t addr, resource_size_t size)
 {
 	struct logic_pio_hwaddr *range;

-- 
2.45.2


  parent reply	other threads:[~2024-10-10 16:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 16:27 [PATCH 0/7] of: Constify DT structs Rob Herring (Arm)
2024-10-10 16:27 ` [PATCH 1/7] PCI: Constify pci_register_io_range() fwnode_handle Rob Herring (Arm)
2024-10-10 22:07   ` Bjorn Helgaas
2024-10-11 14:58   ` Krzysztof Kozlowski
2024-10-10 16:27 ` Rob Herring (Arm) [this message]
2024-10-11 14:59   ` [PATCH 2/7] logic_pio: Constify fwnode_handle Krzysztof Kozlowski
2024-10-11 15:08     ` Rob Herring
2024-10-10 16:27 ` [PATCH 3/7] of: Constify struct device_node function arguments Rob Herring (Arm)
2024-10-11 15:13   ` Krzysztof Kozlowski
2024-10-10 16:27 ` [PATCH 4/7] of: Constify struct property pointers Rob Herring (Arm)
2024-10-11 15:17   ` Krzysztof Kozlowski
2024-10-10 16:27 ` [PATCH 5/7] of: Constify of_changeset_entry function arguments Rob Herring (Arm)
2024-10-11 15:18   ` Krzysztof Kozlowski
2024-10-10 16:27 ` [PATCH 6/7] of: Constify safe_name() kobject arg Rob Herring (Arm)
2024-10-11 15:18   ` Krzysztof Kozlowski
2024-10-10 16:27 ` [PATCH 7/7] of/address: Constify of_busses[] array and pointers Rob Herring (Arm)
2024-10-11 15:20 ` [PATCH 0/7] of: Constify DT structs Krzysztof Kozlowski

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=20241010-dt-const-v1-2-87a51f558425@kernel.org \
    --to=robh@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=saravanak@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).