U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rudi Heitbaum <rudi@heitbaum.com>
To: u-boot@lists.denx.de
Cc: trini@konsulko.com, sjg@chromium.org, philipp.tomsich@vrull.eu,
	kever.yang@rock-chips.com, rudi@heitbaum.com
Subject: [PATCH] rockchip: rk3288: syscon: use per-driver of_match tables
Date: Thu, 11 Jun 2026 12:28:08 +0000	[thread overview]
Message-ID: <aiqp2My_Hd-bHR01@e9030ceee902> (raw)

The OF_PLATDATA section shares a single rk3288_syscon_ids[] table across
four drivers, pointing each driver at its entry via pointer arithmetic:

  .of_match = rk3288_syscon_ids + 1,  /* grf  */
  .of_match = rk3288_syscon_ids + 2,  /* sgrf */
  .of_match = rk3288_syscon_ids + 3,  /* pmu  */

dtoc's src_scan.py parses driver source files to build of-platdata but
does not evaluate pointer arithmetic, so each suffix triggers:

  Warning: unexpected suffix ' + N' on .of_match line for compat
  'rk3288_syscon_ids'

Replace the shared-table-with-offset pattern with small per-driver
tables, eliminating the three build warnings.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
 arch/arm/mach-rockchip/rk3288/syscon_rk3288.c | 21 ++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c b/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c
index 6413d0a88a1..6f974d175b1 100644
--- a/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c
@@ -133,6 +133,21 @@ static int rk3288_syscon_bind_of_plat(struct udevice *dev)
 }
 #endif
 
+static const struct udevice_id rk3288_grf_ids[] = {
+	{ .compatible = "rockchip,rk3288-grf", .data = ROCKCHIP_SYSCON_GRF },
+	{ }
+};
+
+static const struct udevice_id rk3288_sgrf_ids[] = {
+	{ .compatible = "rockchip,rk3288-sgrf", .data = ROCKCHIP_SYSCON_SGRF },
+	{ }
+};
+
+static const struct udevice_id rk3288_pmu_ids[] = {
+	{ .compatible = "rockchip,rk3288-pmu", .data = ROCKCHIP_SYSCON_PMU },
+	{ }
+};
+
 U_BOOT_DRIVER(rockchip_rk3288_noc) = {
 	.name = "rockchip_rk3288_noc",
 	.id = UCLASS_SYSCON,
@@ -148,7 +163,7 @@ U_BOOT_DRIVER(rockchip_rk3288_noc) = {
 U_BOOT_DRIVER(rockchip_rk3288_grf) = {
 	.name = "rockchip_rk3288_grf",
 	.id = UCLASS_SYSCON,
-	.of_match = rk3288_syscon_ids + 1,
+	.of_match = rk3288_grf_ids,
 #if IS_ENABLED(CONFIG_FDT_64BIT)
 	.bind = rk3288_grf_bind_of_plat,
 	.plat_auto = sizeof(struct rockchip_rk3288_grf_plat),
@@ -160,7 +175,7 @@ U_BOOT_DRIVER(rockchip_rk3288_grf) = {
 U_BOOT_DRIVER(rockchip_rk3288_sgrf) = {
 	.name = "rockchip_rk3288_sgrf",
 	.id = UCLASS_SYSCON,
-	.of_match = rk3288_syscon_ids + 2,
+	.of_match = rk3288_sgrf_ids,
 #if IS_ENABLED(CONFIG_FDT_64BIT)
 	.bind = rk3288_sgrf_bind_of_plat,
 	.plat_auto = sizeof(struct rockchip_rk3288_sgrf_plat),
@@ -172,7 +187,7 @@ U_BOOT_DRIVER(rockchip_rk3288_sgrf) = {
 U_BOOT_DRIVER(rockchip_rk3288_pmu) = {
 	.name = "rockchip_rk3288_pmu",
 	.id = UCLASS_SYSCON,
-	.of_match = rk3288_syscon_ids + 3,
+	.of_match = rk3288_pmu_ids,
 #if IS_ENABLED(CONFIG_FDT_64BIT)
 	.bind = rk3288_pmu_bind_of_plat,
 	.plat_auto = sizeof(struct rockchip_rk3288_pmu_plat),
-- 
2.53.0


                 reply	other threads:[~2026-06-11 12:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aiqp2My_Hd-bHR01@e9030ceee902 \
    --to=rudi@heitbaum.com \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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