Re: [PATCH v5 08/11] HID: spi-hid: add device tree support for HID over SPI

From
Uwe Kleine-König <hidden>
Date
2026-10-12 12:49:10
Also in
linux-devicetree, linux-doc, linux-spi, linux-trace-kernel, lkml
Reply to
Jingyuan Liang, 2026-10-09
Hello,

On Fri, Oct 09, 2026 at 10:25:33PM +0000, Jingyuan Liang wrote:
+#include <linux/mod_devicetable.h>
[...]
+#include <linux/spi/spi.h>
Drop <linux/mod_devicetable.h>, the spi header already provides the
needed *_device_id with less dependencies.
quoted hunk ↗ jump to hunk
+static const struct of_device_id spi_hid_of_match[] = {
+	{ .compatible = "hid-over-spi", .data = &timing_data },
+	{}
{ } please
quoted hunk ↗ jump to hunk
+};
+MODULE_DEVICE_TABLE(of, spi_hid_of_match);
+
+static const struct spi_device_id spi_hid_of_id_table[] = {
+	{ "hid", 0 },
+	{ "hid-over-spi", 0 },
+	{ }
+};
Please use named initializers and drop the unused zeros.
quoted hunk ↗ jump to hunk
+MODULE_DEVICE_TABLE(spi, spi_hid_of_id_table);
+
+static struct spi_driver spi_hid_of_driver = {
+	.driver = {
+		.name	= "spi_hid_of",
+		.owner	= THIS_MODULE,
+		.of_match_table = spi_hid_of_match,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
+		.dev_groups = spi_hid_groups,
+	},
+	.probe		= spi_hid_of_probe,
+	.remove		= spi_hid_core_remove,
+	.id_table	= spi_hid_of_id_table,
Very inconsistent alignment of =, if you ask me, just use a single space
before a =.
+};
Best regards
Uwe

Attachments

Thread (56 messages) 56 messages, 6 authors, last reply 19h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help