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

From: Uwe Kleine-König

Date: Mon Oct 12 2026 - 08:56:38 EST


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.

> +static const struct of_device_id spi_hid_of_match[] = {
> + { .compatible = "hid-over-spi", .data = &timing_data },
> + {}

{ } please

> +};
> +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.

> +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

Attachment: signature.asc
Description: PGP signature