Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v1 00/12] nfc: Various cleanups around device_id arrays
@ 2026-07-03 15:46 Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables Uwe Kleine-König (The Capable Hub)
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Krzysztof Kozlowski, Simon Horman,
	Jakub Kicinski, Tomasz Unger, Carl Lee, Ian Ray, Takashi Sakamoto,
	Bjorn Helgaas, Danilo Krummrich, Krzysztof Kozlowski, Mark Greer,
	Paolo Abeni, Pengpeng Hou, Kees Cook, Bartosz Golaszewski,
	Linus Walleij, Johan Hovold, Jialu Xu
  Cc: oe-linux-nfc, linux-kernel, linux-wireless

Hello,

this series's objective is to convert device_id arrays of various
different device types to named initialisation. It contains a few
cleanups left and right that I spotted while working on these changes.

The follow up change is to replace .driver_data by an anonymous union,
see
https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
for the idea.

The changes here are not strictly necessary for my quest, but they align
the device_id structures to how they look and will look for other
subsystems.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (12):
  nfc: Drop __maybe_unused from acpi_device_id tables
  nfc: Drop unused assignment of acpi_device_id driver data
  nfc: Initialize acpi_device_id arrays using member names
  nfc: Unify style of acpi_device_id arrays
  nfc: pn544: Drop empty line between i2c_device_id array and
    MODULE_DEVICE_TABLE()
  nfc: Initialize mei_cl_device_idarrays using member names
  nfc: Drop __maybe_unused from of_device_id tables
  nfc: Unify style of of_device_id arrays
  nfc: Drop unused assignment of spi_device_id driver data
  nfc: Initialize spi_device_idarrays using member names
  nfc: Unify style of spi_device_id arrays
  nfc: Unify style of usb_device_id arrays

 drivers/nfc/fdp/i2c.c       |  4 ++--
 drivers/nfc/microread/mei.c | 10 ++++++----
 drivers/nfc/nfcmrvl/i2c.c   |  6 +++---
 drivers/nfc/nfcmrvl/spi.c   |  8 ++++----
 drivers/nfc/nfcmrvl/usb.c   |  1 -
 drivers/nfc/nxp-nci/i2c.c   | 10 +++++-----
 drivers/nfc/pn533/i2c.c     | 10 +++++-----
 drivers/nfc/pn533/uart.c    |  4 ++--
 drivers/nfc/pn544/i2c.c     | 14 ++++++--------
 drivers/nfc/pn544/mei.c     | 10 ++++++----
 drivers/nfc/port100.c       |  4 ++--
 drivers/nfc/s3fwrn5/i2c.c   |  6 +++---
 drivers/nfc/s3fwrn5/uart.c  |  4 ++--
 drivers/nfc/st-nci/i2c.c    | 18 +++++++++---------
 drivers/nfc/st-nci/spi.c    | 18 +++++++++---------
 drivers/nfc/st21nfca/i2c.c  | 14 +++++++-------
 drivers/nfc/st95hf/core.c   |  8 ++++----
 drivers/nfc/trf7970a.c      | 12 +++++-------
 18 files changed, 80 insertions(+), 81 deletions(-)


base-commit: 6eb8711ece2ce27e52e327a5b7a628ed39b97f45
-- 
2.55.0.11.g153666a7d9bb


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

* [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables
  2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-07-03 15:46 ` Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 08/12] nfc: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Krzysztof Kozlowski, Mark Greer, Simon Horman,
	Tomasz Unger
  Cc: oe-linux-nfc, linux-kernel, linux-wireless

Referencing these arrays in MODULE_DEVICE_TABLE() is enough to convince
the compiler that they are used even if the drivers are built-in (since
5ab23c7923a1 ("modpost: Create modalias for builtin modules"). So the
__maybe_unused marking can be removed without introducing a compiler
warning.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/nfc/nfcmrvl/i2c.c  | 2 +-
 drivers/nfc/nfcmrvl/spi.c  | 2 +-
 drivers/nfc/pn533/i2c.c    | 2 +-
 drivers/nfc/pn544/i2c.c    | 2 +-
 drivers/nfc/s3fwrn5/i2c.c  | 2 +-
 drivers/nfc/st-nci/i2c.c   | 2 +-
 drivers/nfc/st-nci/spi.c   | 2 +-
 drivers/nfc/st21nfca/i2c.c | 2 +-
 drivers/nfc/st95hf/core.c  | 2 +-
 drivers/nfc/trf7970a.c     | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index 66877a7d03f2..687d2979b881 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -245,7 +245,7 @@ static void nfcmrvl_i2c_remove(struct i2c_client *client)
 }
 
 
-static const struct of_device_id of_nfcmrvl_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_nfcmrvl_i2c_match[] = {
 	{ .compatible = "marvell,nfc-i2c", },
 	{},
 };
diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index 9c8cde1250fb..8dd71fed8493 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -181,7 +181,7 @@ static void nfcmrvl_spi_remove(struct spi_device *spi)
 	nfcmrvl_nci_unregister_dev(drv_data->priv);
 }
 
-static const struct of_device_id of_nfcmrvl_spi_match[] __maybe_unused = {
+static const struct of_device_id of_nfcmrvl_spi_match[] = {
 	{ .compatible = "marvell,nfc-spi", },
 	{},
 };
diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c
index 94aca9119f0f..2128083f0297 100644
--- a/drivers/nfc/pn533/i2c.c
+++ b/drivers/nfc/pn533/i2c.c
@@ -236,7 +236,7 @@ static void pn533_i2c_remove(struct i2c_client *client)
 	pn53x_common_clean(phy->priv);
 }
 
-static const struct of_device_id of_pn533_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_pn533_i2c_match[] = {
 	{ .compatible = "nxp,pn532", },
 	/*
 	 * NOTE: The use of the compatibles with the trailing "...-i2c" is
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index b731d0b02f52..50907a1974cd 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -937,7 +937,7 @@ static void pn544_hci_i2c_remove(struct i2c_client *client)
 		pn544_hci_i2c_disable(phy);
 }
 
-static const struct of_device_id of_pn544_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_pn544_i2c_match[] = {
 	{ .compatible = "nxp,pn544-i2c", },
 	{},
 };
diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
index e9a34d27a369..499301a6fa3f 100644
--- a/drivers/nfc/s3fwrn5/i2c.c
+++ b/drivers/nfc/s3fwrn5/i2c.c
@@ -210,7 +210,7 @@ static const struct i2c_device_id s3fwrn5_i2c_id_table[] = {
 };
 MODULE_DEVICE_TABLE(i2c, s3fwrn5_i2c_id_table);
 
-static const struct of_device_id of_s3fwrn5_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_s3fwrn5_i2c_match[] = {
 	{ .compatible = "samsung,s3fwrn5-i2c", },
 	{}
 };
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index f43ae8e92070..ceb7d7450e47 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -269,7 +269,7 @@ static const struct acpi_device_id st_nci_i2c_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match);
 
-static const struct of_device_id of_st_nci_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_st_nci_i2c_match[] = {
 	{ .compatible = "st,st21nfcb-i2c", },
 	{ .compatible = "st,st21nfcb_i2c", },
 	{ .compatible = "st,st21nfcc-i2c", },
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 9303217acd7b..8632cc0cb305 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -283,7 +283,7 @@ static const struct acpi_device_id st_nci_spi_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match);
 
-static const struct of_device_id of_st_nci_spi_match[] __maybe_unused = {
+static const struct of_device_id of_st_nci_spi_match[] = {
 	{ .compatible = "st,st21nfcb-spi", },
 	{}
 };
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 13fb6f5533e0..4e70f591af55 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -583,7 +583,7 @@ static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match);
 
-static const struct of_device_id of_st21nfca_i2c_match[] __maybe_unused = {
+static const struct of_device_id of_st21nfca_i2c_match[] = {
 	{ .compatible = "st,st21nfca-i2c", },
 	{ .compatible = "st,st21nfca_i2c", },
 	{}
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index ffe5b4eab457..1ecd47c6518e 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1054,7 +1054,7 @@ static const struct spi_device_id st95hf_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, st95hf_id);
 
-static const struct of_device_id st95hf_spi_of_match[] __maybe_unused = {
+static const struct of_device_id st95hf_spi_of_match[] = {
 	{ .compatible = "st,st95hf" },
 	{},
 };
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index f22e091019de..bc01b46f461c 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2303,7 +2303,7 @@ static const struct dev_pm_ops trf7970a_pm_ops = {
 			   trf7970a_pm_runtime_resume, NULL)
 };
 
-static const struct of_device_id trf7970a_of_match[] __maybe_unused = {
+static const struct of_device_id trf7970a_of_match[] = {
 	{.compatible = "ti,trf7970a",},
 	{},
 };
-- 
2.55.0.11.g153666a7d9bb


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

* [PATCH v1 08/12] nfc: Unify style of of_device_id arrays
  2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables Uwe Kleine-König (The Capable Hub)
@ 2026-07-03 15:46 ` Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 09/12] nfc: Drop unused assignment of spi_device_id driver data Uwe Kleine-König (The Capable Hub)
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Krzysztof Kozlowski, Mark Greer, Carl Lee,
	Jakub Kicinski, Ian Ray, Paolo Abeni, Pengpeng Hou, Kees Cook,
	Simon Horman, Tomasz Unger
  Cc: oe-linux-nfc, linux-kernel, linux-wireless

The most common style treewide is:

 - A single space in the list terminator and no trailing ,
 - No comma after a named initializers iff the closing } is on the same
   line

Adapt the of_device_id arrays accordingly.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/nfc/nfcmrvl/i2c.c  | 4 ++--
 drivers/nfc/nfcmrvl/spi.c  | 4 ++--
 drivers/nfc/nxp-nci/i2c.c  | 4 ++--
 drivers/nfc/pn533/i2c.c    | 8 ++++----
 drivers/nfc/pn533/uart.c   | 4 ++--
 drivers/nfc/pn544/i2c.c    | 4 ++--
 drivers/nfc/s3fwrn5/i2c.c  | 4 ++--
 drivers/nfc/s3fwrn5/uart.c | 4 ++--
 drivers/nfc/st-nci/i2c.c   | 8 ++++----
 drivers/nfc/st-nci/spi.c   | 4 ++--
 drivers/nfc/st21nfca/i2c.c | 6 +++---
 drivers/nfc/st95hf/core.c  | 2 +-
 drivers/nfc/trf7970a.c     | 5 ++---
 13 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index 687d2979b881..068c5d278a35 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -246,8 +246,8 @@ static void nfcmrvl_i2c_remove(struct i2c_client *client)
 
 
 static const struct of_device_id of_nfcmrvl_i2c_match[] = {
-	{ .compatible = "marvell,nfc-i2c", },
-	{},
+	{ .compatible = "marvell,nfc-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_nfcmrvl_i2c_match);
 
diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index 8dd71fed8493..34842ecc4a05 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -182,8 +182,8 @@ static void nfcmrvl_spi_remove(struct spi_device *spi)
 }
 
 static const struct of_device_id of_nfcmrvl_spi_match[] = {
-	{ .compatible = "marvell,nfc-spi", },
-	{},
+	{ .compatible = "marvell,nfc-spi" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_nfcmrvl_spi_match);
 
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 39b43f8f3bf0..d424452934ec 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -355,8 +355,8 @@ static const struct i2c_device_id nxp_nci_i2c_id_table[] = {
 MODULE_DEVICE_TABLE(i2c, nxp_nci_i2c_id_table);
 
 static const struct of_device_id of_nxp_nci_i2c_match[] = {
-	{ .compatible = "nxp,nxp-nci-i2c", },
-	{}
+	{ .compatible = "nxp,nxp-nci-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
 
diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c
index 2128083f0297..66d201c14a40 100644
--- a/drivers/nfc/pn533/i2c.c
+++ b/drivers/nfc/pn533/i2c.c
@@ -237,14 +237,14 @@ static void pn533_i2c_remove(struct i2c_client *client)
 }
 
 static const struct of_device_id of_pn533_i2c_match[] = {
-	{ .compatible = "nxp,pn532", },
+	{ .compatible = "nxp,pn532" },
 	/*
 	 * NOTE: The use of the compatibles with the trailing "...-i2c" is
 	 * deprecated and will be removed.
 	 */
-	{ .compatible = "nxp,pn533-i2c", },
-	{ .compatible = "nxp,pn532-i2c", },
-	{},
+	{ .compatible = "nxp,pn533-i2c" },
+	{ .compatible = "nxp,pn532-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_pn533_i2c_match);
 
diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c
index e0d67cd2ac9b..83c1ccda0af6 100644
--- a/drivers/nfc/pn533/uart.c
+++ b/drivers/nfc/pn533/uart.c
@@ -238,8 +238,8 @@ static const struct serdev_device_ops pn532_serdev_ops = {
 };
 
 static const struct of_device_id pn532_uart_of_match[] = {
-	{ .compatible = "nxp,pn532", },
-	{},
+	{ .compatible = "nxp,pn532" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pn532_uart_of_match);
 
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 50907a1974cd..7fde3aefae70 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -938,8 +938,8 @@ static void pn544_hci_i2c_remove(struct i2c_client *client)
 }
 
 static const struct of_device_id of_pn544_i2c_match[] = {
-	{ .compatible = "nxp,pn544-i2c", },
-	{},
+	{ .compatible = "nxp,pn544-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_pn544_i2c_match);
 
diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
index 499301a6fa3f..4ba762611711 100644
--- a/drivers/nfc/s3fwrn5/i2c.c
+++ b/drivers/nfc/s3fwrn5/i2c.c
@@ -211,8 +211,8 @@ static const struct i2c_device_id s3fwrn5_i2c_id_table[] = {
 MODULE_DEVICE_TABLE(i2c, s3fwrn5_i2c_id_table);
 
 static const struct of_device_id of_s3fwrn5_i2c_match[] = {
-	{ .compatible = "samsung,s3fwrn5-i2c", },
-	{}
+	{ .compatible = "samsung,s3fwrn5-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_s3fwrn5_i2c_match);
 
diff --git a/drivers/nfc/s3fwrn5/uart.c b/drivers/nfc/s3fwrn5/uart.c
index e17c599a2da5..8f142a255101 100644
--- a/drivers/nfc/s3fwrn5/uart.c
+++ b/drivers/nfc/s3fwrn5/uart.c
@@ -85,8 +85,8 @@ static const struct serdev_device_ops s3fwrn82_serdev_ops = {
 };
 
 static const struct of_device_id s3fwrn82_uart_of_match[] = {
-	{ .compatible = "samsung,s3fwrn82", },
-	{},
+	{ .compatible = "samsung,s3fwrn82" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, s3fwrn82_uart_of_match);
 
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index ceb7d7450e47..152c20b6bb01 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -270,10 +270,10 @@ static const struct acpi_device_id st_nci_i2c_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match);
 
 static const struct of_device_id of_st_nci_i2c_match[] = {
-	{ .compatible = "st,st21nfcb-i2c", },
-	{ .compatible = "st,st21nfcb_i2c", },
-	{ .compatible = "st,st21nfcc-i2c", },
-	{}
+	{ .compatible = "st,st21nfcb-i2c" },
+	{ .compatible = "st,st21nfcb_i2c" },
+	{ .compatible = "st,st21nfcc-i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_st_nci_i2c_match);
 
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 8632cc0cb305..5e0b94050f90 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -284,8 +284,8 @@ static const struct acpi_device_id st_nci_spi_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match);
 
 static const struct of_device_id of_st_nci_spi_match[] = {
-	{ .compatible = "st,st21nfcb-spi", },
-	{}
+	{ .compatible = "st,st21nfcb-spi" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_st_nci_spi_match);
 
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 4e70f591af55..a4c93ff7c5b0 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -584,9 +584,9 @@ static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match);
 
 static const struct of_device_id of_st21nfca_i2c_match[] = {
-	{ .compatible = "st,st21nfca-i2c", },
-	{ .compatible = "st,st21nfca_i2c", },
-	{}
+	{ .compatible = "st,st21nfca-i2c" },
+	{ .compatible = "st,st21nfca_i2c" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_st21nfca_i2c_match);
 
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 1ecd47c6518e..265ab10bbb61 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1056,7 +1056,7 @@ MODULE_DEVICE_TABLE(spi, st95hf_id);
 
 static const struct of_device_id st95hf_spi_of_match[] = {
 	{ .compatible = "st,st95hf" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, st95hf_spi_of_match);
 
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index bc01b46f461c..3802081fb8ee 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2304,10 +2304,9 @@ static const struct dev_pm_ops trf7970a_pm_ops = {
 };
 
 static const struct of_device_id trf7970a_of_match[] = {
-	{.compatible = "ti,trf7970a",},
-	{},
+	{ .compatible = "ti,trf7970a" },
+	{ }
 };
-
 MODULE_DEVICE_TABLE(of, trf7970a_of_match);
 
 static const struct spi_device_id trf7970a_id_table[] = {
-- 
2.55.0.11.g153666a7d9bb


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

* [PATCH v1 09/12] nfc: Drop unused assignment of spi_device_id driver data
  2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 08/12] nfc: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-07-03 15:46 ` Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 10/12] nfc: Initialize spi_device_idarrays using member names Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 11/12] nfc: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)
  4 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Mark Greer; +Cc: oe-linux-nfc, linux-kernel, linux-wireless

The drivers explicitly set the .driver_data member of struct
spi_device_id to zero without relying on that value. Drop these
unused assignments.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/nfc/nfcmrvl/spi.c | 2 +-
 drivers/nfc/st-nci/spi.c  | 4 ++--
 drivers/nfc/st95hf/core.c | 2 +-
 drivers/nfc/trf7970a.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index 34842ecc4a05..f873f5380017 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -188,7 +188,7 @@ static const struct of_device_id of_nfcmrvl_spi_match[] = {
 MODULE_DEVICE_TABLE(of, of_nfcmrvl_spi_match);
 
 static const struct spi_device_id nfcmrvl_spi_id_table[] = {
-	{ "nfcmrvl_spi", 0 },
+	{ "nfcmrvl_spi" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, nfcmrvl_spi_id_table);
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 5e0b94050f90..1bbda3d0a7dc 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -271,8 +271,8 @@ static void st_nci_spi_remove(struct spi_device *dev)
 }
 
 static struct spi_device_id st_nci_spi_id_table[] = {
-	{ST_NCI_SPI_DRIVER_NAME, 0},
-	{"st21nfcb-spi", 0},
+	{ ST_NCI_SPI_DRIVER_NAME },
+	{ "st21nfcb-spi" },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 265ab10bbb61..52fe81a557a0 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1049,7 +1049,7 @@ static const struct nfc_digital_ops st95hf_nfc_digital_ops = {
 };
 
 static const struct spi_device_id st95hf_id[] = {
-	{ "st95hf", 0 },
+	{ "st95hf" },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, st95hf_id);
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 3802081fb8ee..8f36ff82be8b 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2310,7 +2310,7 @@ static const struct of_device_id trf7970a_of_match[] = {
 MODULE_DEVICE_TABLE(of, trf7970a_of_match);
 
 static const struct spi_device_id trf7970a_id_table[] = {
-	{"trf7970a", 0},
+	{ "trf7970a" },
 	{}
 };
 
-- 
2.55.0.11.g153666a7d9bb


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

* [PATCH v1 10/12] nfc: Initialize spi_device_idarrays using member names
  2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
                   ` (2 preceding siblings ...)
  2026-07-03 15:46 ` [PATCH v1 09/12] nfc: Drop unused assignment of spi_device_id driver data Uwe Kleine-König (The Capable Hub)
@ 2026-07-03 15:46 ` Uwe Kleine-König (The Capable Hub)
  2026-07-03 15:46 ` [PATCH v1 11/12] nfc: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)
  4 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Mark Greer; +Cc: oe-linux-nfc, linux-kernel, linux-wireless

While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct
spi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/nfc/nfcmrvl/spi.c | 2 +-
 drivers/nfc/st-nci/spi.c  | 4 ++--
 drivers/nfc/st95hf/core.c | 2 +-
 drivers/nfc/trf7970a.c    | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index f873f5380017..bc5140c194b6 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -188,7 +188,7 @@ static const struct of_device_id of_nfcmrvl_spi_match[] = {
 MODULE_DEVICE_TABLE(of, of_nfcmrvl_spi_match);
 
 static const struct spi_device_id nfcmrvl_spi_id_table[] = {
-	{ "nfcmrvl_spi" },
+	{ .name = "nfcmrvl_spi" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, nfcmrvl_spi_id_table);
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 1bbda3d0a7dc..1b97b2f3f441 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -271,8 +271,8 @@ static void st_nci_spi_remove(struct spi_device *dev)
 }
 
 static struct spi_device_id st_nci_spi_id_table[] = {
-	{ ST_NCI_SPI_DRIVER_NAME },
-	{ "st21nfcb-spi" },
+	{ .name = ST_NCI_SPI_DRIVER_NAME },
+	{ .name = "st21nfcb-spi" },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 52fe81a557a0..d4e3049d138a 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1049,7 +1049,7 @@ static const struct nfc_digital_ops st95hf_nfc_digital_ops = {
 };
 
 static const struct spi_device_id st95hf_id[] = {
-	{ "st95hf" },
+	{ .name = "st95hf" },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, st95hf_id);
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 8f36ff82be8b..673989d5c927 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2310,7 +2310,7 @@ static const struct of_device_id trf7970a_of_match[] = {
 MODULE_DEVICE_TABLE(of, trf7970a_of_match);
 
 static const struct spi_device_id trf7970a_id_table[] = {
-	{ "trf7970a" },
+	{ .name = "trf7970a" },
 	{}
 };
 
-- 
2.55.0.11.g153666a7d9bb


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

* [PATCH v1 11/12] nfc: Unify style of spi_device_id arrays
  2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
                   ` (3 preceding siblings ...)
  2026-07-03 15:46 ` [PATCH v1 10/12] nfc: Initialize spi_device_idarrays using member names Uwe Kleine-König (The Capable Hub)
@ 2026-07-03 15:46 ` Uwe Kleine-König (The Capable Hub)
  4 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-03 15:46 UTC (permalink / raw)
  To: David Heidelberg, Mark Greer; +Cc: oe-linux-nfc, linux-kernel, linux-wireless

Unify the style of the list terminator in spi_device_id arrays, that
is use a single space between { and }. This is the most common and
generally recommended style for these.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 drivers/nfc/st-nci/spi.c  | 2 +-
 drivers/nfc/st95hf/core.c | 2 +-
 drivers/nfc/trf7970a.c    | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 1b97b2f3f441..7948c7e0c88c 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -273,7 +273,7 @@ static void st_nci_spi_remove(struct spi_device *dev)
 static struct spi_device_id st_nci_spi_id_table[] = {
 	{ .name = ST_NCI_SPI_DRIVER_NAME },
 	{ .name = "st21nfcb-spi" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);
 
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index d4e3049d138a..321fbe8aeca8 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1050,7 +1050,7 @@ static const struct nfc_digital_ops st95hf_nfc_digital_ops = {
 
 static const struct spi_device_id st95hf_id[] = {
 	{ .name = "st95hf" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, st95hf_id);
 
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 673989d5c927..c12653ce7462 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2311,9 +2311,8 @@ MODULE_DEVICE_TABLE(of, trf7970a_of_match);
 
 static const struct spi_device_id trf7970a_id_table[] = {
 	{ .name = "trf7970a" },
-	{}
+	{ }
 };
-
 MODULE_DEVICE_TABLE(spi, trf7970a_id_table);
 
 static struct spi_driver trf7970a_spi_driver = {
-- 
2.55.0.11.g153666a7d9bb


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

end of thread, other threads:[~2026-07-03 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 08/12] nfc: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 09/12] nfc: Drop unused assignment of spi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 10/12] nfc: Initialize spi_device_idarrays using member names Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 11/12] nfc: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)

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