mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: Use named initializers for acpi_device_id
@ 2026-11-06 15:55 Pawel Zalewski
  2026-11-06 17:36 ` Adrian Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Zalewski @ 2026-11-06 15:55 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Hu Ziji
  Cc: linux-mmc, linux-kernel, linux-arm-kernel, Pawel Zalewski

Use a designated initializer for the acpi_device_id fields which makes the
code more readable and consistent with how lists are initialized in the
rest of the kernel code base.

Unify the list terminator to have a single space between the brackets and
no trailing comma.

Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
This series is converting lists that contain the acpi_device_id struct,
which is defined in the include/linux/device-id/acpi.h to make use of named
initializers (which they do not use currently). This work is part of the on
going effort in the kernel associated with device-ids [1]

The plan is to convert acpi_device_id::driver_data to have an anonymous
union, similarly to what was introduced for PCI and I2C device ID tables.
The goal is to increase type-safety (most of the existing casts are gone),
to improve readability and to make use intent a bit more clear:

```
union {
	kernel_ulong_t driver_data;
	const void *driver_data_ptr;
}
```

But for that to work all lists containing the structs need to use named
initializers first to avoid triggering -Wmissing-braces. I already have
patches that implement this and touching a lot of kernel subsystmes that
use the acpi_device_id struct and that list keeps on growing. Therefore,
I have decided to split the series per every subsystem into:
- pre-clean-ups that convert the lists to use named initializers
  (which is this series)
- actual implementations that make some of the modules use the new
  driver_data_ptr member

That way the task can be fragmented into manageable and independent chunks
of work and makes this effort easier to review.

[1] https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
---
 drivers/mmc/host/sdhci-acpi.c       | 30 +++++++++++++++---------------
 drivers/mmc/host/sdhci-iproc.c      |  2 +-
 drivers/mmc/host/sdhci-of-dwcmshc.c |  2 +-
 drivers/mmc/host/sdhci-xenon.c      |  8 ++++----
 drivers/mmc/host/sdhci_f_sdh30.c    |  4 ++--
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 84c7054607fc..e97c33614fd1 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -704,21 +704,21 @@ static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
 };
 
 static const struct acpi_device_id sdhci_acpi_ids[] = {
-	{ "80865ACA" },
-	{ "80865ACC" },
-	{ "80865AD0" },
-	{ "80860F14" },
-	{ "80860F16" },
-	{ "INT33BB"  },
-	{ "INT33C6"  },
-	{ "INT3436"  },
-	{ "INT344D"  },
-	{ "PNP0D40"  },
-	{ "QCOM8051" },
-	{ "QCOM8052" },
-	{ "AMDI0040" },
-	{ "AMDI0041" },
-	{ },
+	{ .id = "80865ACA" },
+	{ .id = "80865ACC" },
+	{ .id = "80865AD0" },
+	{ .id = "80860F14" },
+	{ .id = "80860F16" },
+	{ .id = "INT33BB" },
+	{ .id = "INT33C6" },
+	{ .id = "INT3436" },
+	{ .id = "INT344D" },
+	{ .id = "PNP0D40" },
+	{ .id = "QCOM8051" },
+	{ .id = "QCOM8052" },
+	{ .id = "AMDI0040" },
+	{ .id = "AMDI0041" },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
 
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index 35ef5c5f5146..db5bed2397f6 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -350,7 +350,7 @@ static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
 	{ .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
 	{ .id = "BCM2847",  .driver_data = (kernel_ulong_t)&bcm_arasan_data },
 	{ .id = "BRCME88C", .driver_data = (kernel_ulong_t)&bcm2711_data },
-	{ /* sentinel */ }
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
 #endif
diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index 09702022e708..113a9399d7dc 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -2400,7 +2400,7 @@ static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = {
 		.id = "MLNXBF30",
 		.driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata,
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_dwcmshc_acpi_ids);
 #endif
diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
index 046e8100dd08..2e4926e722f3 100644
--- a/drivers/mmc/host/sdhci-xenon.c
+++ b/drivers/mmc/host/sdhci-xenon.c
@@ -700,10 +700,10 @@ MODULE_DEVICE_TABLE(of, sdhci_xenon_dt_ids);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id sdhci_xenon_acpi_ids[] = {
-	{ .id = "MRVL0002", XENON_AP806},
-	{ .id = "MRVL0003", XENON_AP807},
-	{ .id = "MRVL0004", XENON_CP110},
-	{}
+	{ .id = "MRVL0002", .driver_data = XENON_AP806 },
+	{ .id = "MRVL0003", .driver_data = XENON_AP807 },
+	{ .id = "MRVL0004", .driver_data = XENON_CP110 },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_xenon_acpi_ids);
 #endif
diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index e9b934e159ad..f3d0a50d1a6f 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -227,8 +227,8 @@ MODULE_DEVICE_TABLE(of, f_sdh30_dt_ids);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id f_sdh30_acpi_ids[] = {
-	{ "SCX0002" },
-	{ /* sentinel */ }
+	{ .id = "SCX0002" },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, f_sdh30_acpi_ids);
 #endif

---
base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1
change-id: 20261102-acpi-mmc-7bbb96467dd8

Best regards,
--  
Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-06 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 15:55 [PATCH] mmc: sdhci: Use named initializers for acpi_device_id Pawel Zalewski
2026-11-06 17:36 ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®