public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@kernel.org>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej@kernel.org>,
	Samuel Holland <samuel@sholland.org>
Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] soc: sunxi: sram: Const-ify sunxi_sram_func data and references
Date: Wed, 25 Mar 2026 00:43:51 +0800	[thread overview]
Message-ID: <20260324164357.1607247-4-wens@kernel.org> (raw)
In-Reply-To: <20260324164357.1607247-1-wens@kernel.org>

sunxi_sram_func contains value mapping that do not change at runtime.

Const-ify them.

Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 drivers/soc/sunxi/sunxi_sram.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 446b9fc1f175..5e8c80ae3509 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -29,11 +29,11 @@ struct sunxi_sram_func {
 };
 
 struct sunxi_sram_data {
-	char			*name;
-	u8			reg;
-	u8			offset;
-	u8			width;
-	struct sunxi_sram_func	*func;
+	char				*name;
+	u8				reg;
+	u8				offset;
+	u8				width;
+	const struct sunxi_sram_func	*func;
 };
 
 struct sunxi_sram_desc {
@@ -54,7 +54,7 @@ struct sunxi_sram_desc {
 		.reg = _reg,					\
 		.offset = _off,					\
 		.width = _width,				\
-		.func = (struct sunxi_sram_func[]){		\
+		.func = (const struct sunxi_sram_func[]){	\
 			__VA_ARGS__, { } },			\
 	}
 
@@ -111,7 +111,7 @@ static int sunxi_sram_show(struct seq_file *s, void *data)
 	struct device_node *sram_node, *section_node;
 	const struct sunxi_sram_data *sram_data;
 	const struct of_device_id *match;
-	struct sunxi_sram_func *func;
+	const struct sunxi_sram_func *func;
 	const __be32 *sram_addr_p, *section_addr_p;
 	u32 val;
 
@@ -169,7 +169,7 @@ static const struct sunxi_sram_data *sunxi_sram_of_parse(struct device_node *nod
 {
 	const struct of_device_id *match;
 	const struct sunxi_sram_data *data;
-	struct sunxi_sram_func *func;
+	const struct sunxi_sram_func *func;
 	struct of_phandle_args args;
 	u8 val;
 	int ret;
-- 
2.47.3


  parent reply	other threads:[~2026-03-24 16:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 16:43 [PATCH 0/7] soc: sunxi: sram: Add H616 SRAM support Chen-Yu Tsai
2026-03-24 16:43 ` [PATCH 1/7] dt-bindings: sram: Document Allwinner H616 VE SRAM Chen-Yu Tsai
2026-03-25  0:22   ` Jernej Škrabec
2026-03-24 16:43 ` [PATCH 2/7] dt-bindings: sram: sunxi-sram: Add H616 SRAM regions Chen-Yu Tsai
2026-03-25  0:23   ` Jernej Škrabec
2026-03-24 16:43 ` Chen-Yu Tsai [this message]
2026-03-25  0:24   ` [PATCH 3/7] soc: sunxi: sram: Const-ify sunxi_sram_func data and references Jernej Škrabec
2026-03-24 16:43 ` [PATCH 4/7] soc: sunxi: sram: Allow SRAM to be claimed multiple times Chen-Yu Tsai
2026-03-25  0:25   ` Jernej Škrabec
2026-03-24 16:43 ` [PATCH 5/7] soc: sunxi: sram: Support claiming multiple regions per device Chen-Yu Tsai
2026-03-25  0:28   ` Jernej Škrabec
2026-03-24 16:43 ` [PATCH 6/7] soc: sunxi: sram: Add H616 SRAM regions Chen-Yu Tsai
2026-03-25  0:29   ` Jernej Škrabec
2026-03-24 16:43 ` [PATCH 7/7] arm64: dts: allwinner: sun50i-h616: Add SRAM nodes Chen-Yu Tsai
2026-03-25  0:30   ` Jernej Škrabec

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=20260324164357.1607247-4-wens@kernel.org \
    --to=wens@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox