From 347c1481c122aa78af7a41500af9ad04d11e57b1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 7 Jun 2026 22:00:34 -0700 Subject: [PATCH 01/18] nfc: pn533: fix memcpy overflow warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] As suggested, add a struct_group and memcpy that. Also replace 9 with sizeof for clarify. Signed-off-by: Rosen Penev Link: https://patch.msgid.link/20260608050034.5679-1-rosenp@gmail.com Signed-off-by: David Heidelberg --- drivers/nfc/pn533/pn533.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index d7bdbc82e2ba..4e721a8dfd8b 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -740,8 +740,10 @@ static int pn533_target_found_type_a(struct nfc_target *nfc_tgt, u8 *tgt_data, struct pn533_target_felica { u8 pol_res; - u8 opcode; - u8 nfcid2[NFC_NFCID2_MAXSIZE]; + struct_group(sensf_res, + u8 opcode; + u8 nfcid2[NFC_NFCID2_MAXSIZE]; + ); u8 pad[8]; /* optional */ u8 syst_code[]; @@ -778,8 +780,8 @@ static int pn533_target_found_felica(struct nfc_target *nfc_tgt, u8 *tgt_data, else nfc_tgt->supported_protocols = NFC_PROTO_FELICA_MASK; - memcpy(nfc_tgt->sensf_res, &tgt_felica->opcode, 9); - nfc_tgt->sensf_res_len = 9; + memcpy(nfc_tgt->sensf_res, &tgt_felica->sensf_res, sizeof(tgt_felica->sensf_res)); + nfc_tgt->sensf_res_len = sizeof(tgt_felica->sensf_res); memcpy(nfc_tgt->nfcid2, tgt_felica->nfcid2, NFC_NFCID2_MAXSIZE); nfc_tgt->nfcid2_len = NFC_NFCID2_MAXSIZE; From 9efd35acb385d8cba179ac833430596f1674a2dc Mon Sep 17 00:00:00 2001 From: Linmao Li Date: Mon, 6 Jul 2026 15:57:42 +0800 Subject: [PATCH 02/18] nfc: trf7970a: Use NULL when no response is expected When a command's timeout is zero, no response is expected, and the TX interrupt handler completes the command by passing ERR_PTR(0) to the digital callback. ERR_PTR(0) evaluates to NULL, so no errno is encoded here. Use NULL directly to avoid suggesting that this is an error-pointer path. Signed-off-by: Linmao Li Link: https://patch.msgid.link/20260706075743.564658-1-lilinmao@kylinos.cn Signed-off-by: David Heidelberg --- drivers/nfc/trf7970a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index f22e091019de..eba00a8cb5c0 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -938,7 +938,7 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id) if (!trf->timeout) { trf->ignore_timeout = !cancel_delayed_work(&trf->timeout_work); - trf->rx_skb = ERR_PTR(0); + trf->rx_skb = NULL; trf7970a_send_upstream(trf); break; } From d832b95697384a2b67f20b35106bbf925358cde9 Mon Sep 17 00:00:00 2001 From: Griffin Kroah-Hartman Date: Tue, 7 Jul 2026 16:22:17 +0200 Subject: [PATCH 03/18] nfc: mrvl: spi: Unregister dev on allocation fail Call nfcmrvl_nci_unregister_dev() if nci_spi_allocate_spi() fails, unwrapping the previous call to nfcmrvl_nci_register_dev() during the nfcmrvl_spi_probe() function. Assisted-by: gkh-clanker-2000 Cc: David Heidelberg Signed-off-by: Griffin Kroah-Hartman Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/2026070716-crucial-slouchy-b8a9@gregkh Signed-off-by: David Heidelberg --- drivers/nfc/nfcmrvl/spi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c index 9c8cde1250fb..dad07c8e13b8 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -168,6 +168,10 @@ static int nfcmrvl_spi_probe(struct spi_device *spi) drv_data->nci_spi = nci_spi_allocate_spi(drv_data->spi, 0, 10, drv_data->priv->ndev); + if (!drv_data->nci_spi) { + nfcmrvl_nci_unregister_dev(drv_data->priv); + return -ENOMEM; + } /* Init completion for slave handshake */ init_completion(&drv_data->handshake_completion); From 56345cea6a30dc7a1b036d5fb7900434b4a4c5e8 Mon Sep 17 00:00:00 2001 From: Griffin Kroah-Hartman Date: Tue, 7 Jul 2026 16:23:27 +0200 Subject: [PATCH 04/18] nfc: nxp-nci: Add remove on IRQ error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a call to nxp_nci_remove() in nxp_nci_i2c_probe() when the request_threaded_irq() fails. Previously, IRQ resources were not being freed upon error. Assisted-by: gkh_clanker_2000 Cc: David Heidelberg Cc: Carl Lee Cc: Jakub Kicinski Cc: Krzysztof Kozlowski Cc: Ian Ray Cc: "Uwe Kleine-König (The Capable Hub)" Signed-off-by: Griffin Kroah-Hartman Signed-off-by: Greg Kroah-Hartman Reviewed-by: Ian Ray Link: https://patch.msgid.link/2026070726-observer-fang-9716@gregkh Signed-off-by: David Heidelberg --- drivers/nfc/nxp-nci/i2c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index faebc89a7ef5..564f38735510 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -334,8 +334,10 @@ static int nxp_nci_i2c_probe(struct i2c_client *client) nxp_nci_i2c_irq_thread_fn, irqflags | IRQF_ONESHOT, NXP_NCI_I2C_DRIVER_NAME, phy); - if (r < 0) + if (r < 0) { nfc_err(&client->dev, "Unable to register IRQ handler\n"); + nxp_nci_remove(phy->ndev); + } return r; } From b65365e14098f0aa6fd0e3ff53caca343e575ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:15 +0200 Subject: [PATCH 05/18] nfc: Drop __maybe_unused from acpi_device_id tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/4c25d7a7f81d5117cd5d0de4a9f06ed0552e8793.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/pn544/i2c.c | 2 +- drivers/nfc/st-nci/i2c.c | 2 +- drivers/nfc/st-nci/spi.c | 2 +- drivers/nfc/st21nfca/i2c.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index dcfa96bd4345..419b014d232e 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -50,7 +50,7 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); -static const struct acpi_device_id pn544_hci_i2c_acpi_match[] __maybe_unused = { +static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = { {"NXP5440", 0}, {} }; diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 9ae839a6f5cc..4ddf0cc2a259 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c @@ -262,7 +262,7 @@ static const struct i2c_device_id st_nci_i2c_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table); -static const struct acpi_device_id st_nci_i2c_acpi_match[] __maybe_unused = { +static const struct acpi_device_id st_nci_i2c_acpi_match[] = { {"SMO2101"}, {"SMO2102"}, {} diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index 169eacc0a32a..42f5f477e807 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -277,7 +277,7 @@ static struct spi_device_id st_nci_spi_id_table[] = { }; MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table); -static const struct acpi_device_id st_nci_spi_acpi_match[] __maybe_unused = { +static const struct acpi_device_id st_nci_spi_acpi_match[] = { {"SMO2101", 0}, {} }; diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index aa5f4922b6b0..577434df5ff3 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -577,7 +577,7 @@ static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table); -static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] __maybe_unused = { +static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = { {"SMO2100", 0}, {} }; From 23096d984885af49ac64b18b2d245fbd71b6c0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:16 +0200 Subject: [PATCH 06/18] nfc: Drop unused assignment of acpi_device_id driver data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drivers explicitly set the .driver_data member of struct acpi_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) Link: https://patch.msgid.link/c77f6376214001297f28d3ec48f0a853985f1847.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/fdp/i2c.c | 2 +- drivers/nfc/pn544/i2c.c | 3 +-- drivers/nfc/st-nci/spi.c | 2 +- drivers/nfc/st21nfca/i2c.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index c1896a1d978c..9d589b388432 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -349,7 +349,7 @@ static void fdp_nci_i2c_remove(struct i2c_client *client) } static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = { - {"INT339A", 0}, + { "INT339A" }, {} }; MODULE_DEVICE_TABLE(acpi, fdp_nci_i2c_acpi_match); diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 419b014d232e..66d070b18b4d 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -51,10 +51,9 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = { - {"NXP5440", 0}, + { "NXP5440" }, {} }; - MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match); #define PN544_HCI_I2C_DRIVER_NAME "pn544_hci_i2c" diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index 42f5f477e807..c94d67f33184 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -278,7 +278,7 @@ static struct spi_device_id st_nci_spi_id_table[] = { MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table); static const struct acpi_device_id st_nci_spi_acpi_match[] = { - {"SMO2101", 0}, + { "SMO2101" }, {} }; MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match); diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index 577434df5ff3..d6cb74a89f93 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -578,7 +578,7 @@ static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table); static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = { - {"SMO2100", 0}, + { "SMO2100" }, {} }; MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match); From 42d470a98e22e370262d8227c65f16a3b317a7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:17 +0200 Subject: [PATCH 07/18] nfc: Initialize acpi_device_id arrays using member names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 acpi_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. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Ian Ray Link: https://patch.msgid.link/5f60cd3e9831aac3995ed1a1b074ca1ae32e5286.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/fdp/i2c.c | 2 +- drivers/nfc/nxp-nci/i2c.c | 6 +++--- drivers/nfc/pn544/i2c.c | 2 +- drivers/nfc/st-nci/i2c.c | 4 ++-- drivers/nfc/st-nci/spi.c | 2 +- drivers/nfc/st21nfca/i2c.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index 9d589b388432..47f3838ac9d4 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -349,7 +349,7 @@ static void fdp_nci_i2c_remove(struct i2c_client *client) } static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = { - { "INT339A" }, + { .id = "INT339A" }, {} }; MODULE_DEVICE_TABLE(acpi, fdp_nci_i2c_acpi_match); diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index 564f38735510..3fa24f540802 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -364,9 +364,9 @@ MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match); #ifdef CONFIG_ACPI static const struct acpi_device_id acpi_id[] = { - { "NXP1001" }, - { "NXP1002" }, - { "NXP7471" }, + { .id = "NXP1001" }, + { .id = "NXP1002" }, + { .id = "NXP7471" }, { } }; MODULE_DEVICE_TABLE(acpi, acpi_id); diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 66d070b18b4d..ccca07eb828c 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -51,7 +51,7 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = { - { "NXP5440" }, + { .id = "NXP5440" }, {} }; MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match); diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 4ddf0cc2a259..3906a806ec8b 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c @@ -263,8 +263,8 @@ static const struct i2c_device_id st_nci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table); static const struct acpi_device_id st_nci_i2c_acpi_match[] = { - {"SMO2101"}, - {"SMO2102"}, + { .id = "SMO2101" }, + { .id = "SMO2102" }, {} }; MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match); diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index c94d67f33184..8fc60a972d98 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -278,7 +278,7 @@ static struct spi_device_id st_nci_spi_id_table[] = { MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table); static const struct acpi_device_id st_nci_spi_acpi_match[] = { - { "SMO2101" }, + { .id = "SMO2101" }, {} }; MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match); diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index d6cb74a89f93..e5109f701795 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -578,7 +578,7 @@ static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = { MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table); static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = { - { "SMO2100" }, + { .id = "SMO2100" }, {} }; MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match); From e440889dfd25c5d4328cf4624f0379e065f895fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:18 +0200 Subject: [PATCH 08/18] nfc: Unify style of acpi_device_id arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify the style of the list terminator in acpi_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) Link: https://patch.msgid.link/30cd94a6821917f16daffdce5fabf145432c13eb.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/fdp/i2c.c | 2 +- drivers/nfc/pn544/i2c.c | 2 +- drivers/nfc/st-nci/i2c.c | 2 +- drivers/nfc/st-nci/spi.c | 2 +- drivers/nfc/st21nfca/i2c.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index 47f3838ac9d4..13d4387e79a0 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -350,7 +350,7 @@ static void fdp_nci_i2c_remove(struct i2c_client *client) static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = { { .id = "INT339A" }, - {} + { } }; MODULE_DEVICE_TABLE(acpi, fdp_nci_i2c_acpi_match); diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index ccca07eb828c..9ed1cde1de2e 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -52,7 +52,7 @@ MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = { { .id = "NXP5440" }, - {} + { } }; MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match); diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 3906a806ec8b..f43ae8e92070 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c @@ -265,7 +265,7 @@ MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table); static const struct acpi_device_id st_nci_i2c_acpi_match[] = { { .id = "SMO2101" }, { .id = "SMO2102" }, - {} + { } }; MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match); diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index 8fc60a972d98..9303217acd7b 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -279,7 +279,7 @@ MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table); static const struct acpi_device_id st_nci_spi_acpi_match[] = { { .id = "SMO2101" }, - {} + { } }; MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match); diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index e5109f701795..13fb6f5533e0 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -579,7 +579,7 @@ MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table); static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = { { .id = "SMO2100" }, - {} + { } }; MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match); From dc0650569a466b234bf3bf06d9c238614015fb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:19 +0200 Subject: [PATCH 09/18] nfc: pn544: Drop empty line between i2c_device_id array and MODULE_DEVICE_TABLE() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usually there is no empty line between a module device table and the respective MODULE_DEVICE_TABLE(): $ git grep -h -B1 ^MODULE_DEVICE_TABLE v7.1-rc1 | sort | uniq -c | sort -n ... 1388 8129 }; 9784 -- (The `--` is part of grep output to separate the matches with their context from each other, that's not the most usual line before MODULE_DEVICE_TABLE(...).) Signed-off-by: Uwe Kleine-König (The Capable Hub) Link: https://patch.msgid.link/7562d0062948a474957d8d733c0e8a70de502624.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/pn544/i2c.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 9ed1cde1de2e..b731d0b02f52 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -47,7 +47,6 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = { { .name = "pn544" }, { } }; - MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table); static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = { From 15aa65539aa768c7acd9ae3a845df305caa72688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:20 +0200 Subject: [PATCH 10/18] nfc: Initialize mei_cl_device_idarrays using member names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 mei_cl_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) Link: https://patch.msgid.link/cdc9bbac2e0743550970e565f57996c8a833446f.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/microread/mei.c | 10 ++++++---- drivers/nfc/pn544/mei.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c index c256ae92d6b1..484e3ae0e875 100644 --- a/drivers/nfc/microread/mei.c +++ b/drivers/nfc/microread/mei.c @@ -48,10 +48,12 @@ static void microread_mei_remove(struct mei_cl_device *cldev) } static struct mei_cl_device_id microread_mei_tbl[] = { - { MICROREAD_DRIVER_NAME, MEI_NFC_UUID, MEI_CL_VERSION_ANY}, - - /* required last entry */ - { } + { + .name = MICROREAD_DRIVER_NAME, + .uuid = MEI_NFC_UUID, + .version = MEI_CL_VERSION_ANY, + }, + { /* required last entry */ } }; MODULE_DEVICE_TABLE(mei, microread_mei_tbl); diff --git a/drivers/nfc/pn544/mei.c b/drivers/nfc/pn544/mei.c index 3d3755cfa71e..7ca117186d3e 100644 --- a/drivers/nfc/pn544/mei.c +++ b/drivers/nfc/pn544/mei.c @@ -47,10 +47,12 @@ static void pn544_mei_remove(struct mei_cl_device *cldev) } static struct mei_cl_device_id pn544_mei_tbl[] = { - { PN544_DRIVER_NAME, MEI_NFC_UUID, MEI_CL_VERSION_ANY}, - - /* required last entry */ - { } + { + .name = PN544_DRIVER_NAME, + .uuid = MEI_NFC_UUID, + .version = MEI_CL_VERSION_ANY, + }, + { /* required last entry */ } }; MODULE_DEVICE_TABLE(mei, pn544_mei_tbl); From 777fd2dab44601ea7f59a104e9553e3eb7329782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:21 +0200 Subject: [PATCH 11/18] nfc: Drop __maybe_unused from of_device_id tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/031ea0ae38838df3261f844eb13e9841769b49a7.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- 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 dad07c8e13b8..5c04c2489603 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -185,7 +185,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 eba00a8cb5c0..a2f0d1fd3b92 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",}, {}, }; From ce2d85e3d293b392ab8f1729a71788fae83ef254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:22 +0200 Subject: [PATCH 12/18] nfc: Unify style of of_device_id arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Reviewed-by: Ian Ray Link: https://patch.msgid.link/583375dcd834f5edf6241b09cdd75ad4f32af668.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- 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 5c04c2489603..05d6ee7d4d2a 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -186,8 +186,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 3fa24f540802..92ce096e9b18 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -357,8 +357,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 a2f0d1fd3b92..5ba4e3bd1bf6 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[] = { From 5be3e23a47950a169bc2ea97d02b485d81b5c7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:23 +0200 Subject: [PATCH 13/18] nfc: Drop unused assignment of spi_device_id driver data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/c645d5855d26307d6164122412335533febbf8b9.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- 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 05d6ee7d4d2a..6faf3fbd6911 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -192,7 +192,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 5ba4e3bd1bf6..bb3f83adf7db 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" }, {} }; From d9d8172a641af38397a5750db0dbfb41e4504727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:24 +0200 Subject: [PATCH 14/18] nfc: Initialize spi_device_idarrays using member names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/308a0d43ef042566ca595f1afa803cac592a4643.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- 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 6faf3fbd6911..8b8f00dac0f8 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -192,7 +192,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 bb3f83adf7db..b9ea2b61c588 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" }, {} }; From ebfff6a5e512c92c436a70d91772413534500c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:25 +0200 Subject: [PATCH 15/18] nfc: Unify style of spi_device_id arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/78d632098fd42dbf2846cb89d66ec83bb9e1de99.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- 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 b9ea2b61c588..60883001fa5d 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 = { From 4f3436117435d853057b608fa0ba5c1c204956be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:26 +0200 Subject: [PATCH 16/18] nfc: Unify style of usb_device_id arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The usual coding style is to skip the comma after a initializer iff the closing } is on the same line. Also there is usually no empty line between the array and the MODULE_DEVICE_TABLE() macro. Adapt two drivers accordingly to match this common style. Signed-off-by: Uwe Kleine-König (The Capable Hub) Link: https://patch.msgid.link/8a186cb0376deb3d4f4264e6ed351562b79bb53d.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/nfcmrvl/usb.c | 1 - drivers/nfc/port100.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c index 4babde8e4249..c7f2afe00b93 100644 --- a/drivers/nfc/nfcmrvl/usb.c +++ b/drivers/nfc/nfcmrvl/usb.c @@ -17,7 +17,6 @@ static struct usb_device_id nfcmrvl_table[] = { USB_CLASS_VENDOR_SPEC, 4, 1) }, { } /* Terminating entry */ }; - MODULE_DEVICE_TABLE(usb, nfcmrvl_table); #define NFCMRVL_USB_BULK_RUNNING 1 diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c index 5ae61d7ebcfe..b613f5e2fd57 100644 --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -1480,8 +1480,8 @@ static const struct nfc_digital_ops port100_digital_ops = { }; static const struct usb_device_id port100_table[] = { - { USB_DEVICE(SONY_VENDOR_ID, RCS380S_PRODUCT_ID), }, - { USB_DEVICE(SONY_VENDOR_ID, RCS380P_PRODUCT_ID), }, + { USB_DEVICE(SONY_VENDOR_ID, RCS380S_PRODUCT_ID) }, + { USB_DEVICE(SONY_VENDOR_ID, RCS380P_PRODUCT_ID) }, { } }; MODULE_DEVICE_TABLE(usb, port100_table); From 11a8f09e7f2313383851453285479f5c6843b39d Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Mon, 20 Jul 2026 12:06:59 +0200 Subject: [PATCH 17/18] MAINTAINERS: Add Matrix channel to the NFC subsystem Community hang out there. Signed-off-by: David Heidelberg --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8014b9f8253e..728228f1147e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19100,6 +19100,7 @@ F: include/net/net_failover.h NFC SUBSYSTEM M: David Heidelberg L: oe-linux-nfc@lists.linux.dev +C: https://matrix.to/#/#linux-nfc:ixit.cz S: Maintained T: git https://codeberg.org/linux-nfc/linux.git F: Documentation/devicetree/bindings/net/nfc/ From 9f69d05b5a85c417c73fa2d5c7a2d507ac81cf4b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 24 Jul 2026 16:00:15 -0700 Subject: [PATCH 18/18] nfc: st95hf: switch to using sleeping variants of gpiod API The driver does not use gpiod API calls in an atomic context. Switch to gpiod_set_value_cansleep() calls to allow using the driver with GPIO controllers that might need process context to operate. Signed-off-by: Dmitry Torokhov Link: https://patch.msgid.link/amPsnh9wDIG2CeSi@google.com Signed-off-by: David Heidelberg --- drivers/nfc/st95hf/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 321fbe8aeca8..4d772a308bff 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -450,19 +450,19 @@ static int st95hf_select_protocol(struct st95hf_context *stcontext, int type) static void st95hf_send_st95enable_negativepulse(struct st95hf_context *st95con) { /* First make irq_in pin high */ - gpiod_set_value(st95con->enable_gpiod, HIGH); + gpiod_set_value_cansleep(st95con->enable_gpiod, HIGH); /* wait for 1 milisecond */ usleep_range(1000, 2000); /* Make irq_in pin low */ - gpiod_set_value(st95con->enable_gpiod, LOW); + gpiod_set_value_cansleep(st95con->enable_gpiod, LOW); /* wait for minimum interrupt pulse to make st95 active */ usleep_range(1000, 2000); /* At end make it high */ - gpiod_set_value(st95con->enable_gpiod, HIGH); + gpiod_set_value_cansleep(st95con->enable_gpiod, HIGH); } /*