Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jingyuan Liang" <jingyliang@chromium.org>
Cc: linux-input@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	dmitry.torokhov@gmail.com
Subject: Re: [PATCH v6 03/11] HID: spi-hid: add transport driver skeleton for HID over SPI bus
Date: Mon, 19 Oct 2026 19:11:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-178136@kernel.org> (raw)
In-Reply-To: <20261019-send-upstream-v6-3-cb9ba4b3d6fa@chromium.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] HID: spi-hid: multi-value sysfs attributes and missing ABI documentation
--

commit 4c66f3d16c395b79d0997b29357fb80b5a6f2708
Author: Angela Czubak <acz@semihalf.com>

HID: spi-hid: add transport driver skeleton for HID over SPI bus

This commit creates the spi-hid directory with its Kconfig and Makefile, and
adds the initial core driver skeleton including basic device structures,
sysfs attributes, and probe/remove functions.

> diff --git a/drivers/hid/spi-hid/spi-hid-core.c b/drivers/hid/spi-hid/spi-hid-core.c
> new file mode 100644
> index 0000000000000..02a7608c4b882
> --- /dev/null
> +++ b/drivers/hid/spi-hid/spi-hid-core.c
> @@ -0,0 +1,213 @@

[ ... ]

> +static ssize_t bus_error_count_show(struct device *dev,
> +				    struct device_attribute *attr, char *buf)
> +{
> +	struct spi_hid *shid = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%u (%d)\n",
> +			  shid->bus_error_count, shid->bus_last_error);
> +}
> +static DEVICE_ATTR_RO(bus_error_count);
> +
> +static ssize_t regulator_error_count_show(struct device *dev,
> +					  struct device_attribute *attr,
> +					  char *buf)
> +{
> +	struct spi_hid *shid = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%u (%d)\n",
> +			  shid->regulator_error_count,
> +			  shid->regulator_last_error);
> +}
> +static DEVICE_ATTR_RO(regulator_error_count);
> +
> +static ssize_t device_initiated_reset_count_show(struct device *dev,
> +						 struct device_attribute *attr,
> +						 char *buf)
> +{
> +	struct spi_hid *shid = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%u\n", shid->dir_count);
> +}
> +static DEVICE_ATTR_RO(device_initiated_reset_count);
> +
> +static struct attribute *spi_hid_attrs[] = {
> +	&dev_attr_bus_error_count.attr,
> +	&dev_attr_regulator_error_count.attr,
> +	&dev_attr_device_initiated_reset_count.attr,
> +	NULL	/* Terminator */
> +};
> +
> +static const struct attribute_group spi_hid_group = {
> +	.attrs = spi_hid_attrs,
> +};
> +
> +const struct attribute_group *spi_hid_groups[] = {
> +	&spi_hid_group,
> +	NULL
> +};
> +EXPORT_SYMBOL_GPL(spi_hid_groups);

[Severity: Low]
In drivers/hid/spi-hid/spi-hid-core.c, bus_error_count_show() and
regulator_error_count_show() format both an unsigned error count and a signed
last error code in parentheses ("%u (%d)\n") into a single sysfs file when
userspace reads bus_error_count or regulator_error_count via spi_hid_groups
(which is attached to .dev_groups in the later ACPI and Device Tree support
commits in this series).

Per Documentation/filesystems/sysfs.rst, sysfs attributes should export one
value per file without custom formatting or mixing types, and new sysfs
attributes should be documented in Documentation/ABI/.

Should bus_last_error and regulator_last_error be split into separate sysfs
attributes (or moved to debugfs), and should Documentation/ABI/ entries be
added for the attributes in spi_hid_attrs?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261019-send-upstream-v6-0-cb9ba4b3d6fa@chromium.org?part=3

  reply	other threads:[~2026-10-19 19:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 19:01 [PATCH v6 00/11] Add spi-hid transport driver Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 01/11] Documentation: Correction in HID output_report callback description Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 02/11] HID: Add BUS_SPI support and define HID_SPI_DEVICE macro Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 03/11] HID: spi-hid: add transport driver skeleton for HID over SPI bus Jingyuan Liang
2026-10-19 19:11   ` sashiko-bot [this message]
2026-10-19 19:01 ` [PATCH v6 04/11] HID: spi-hid: add spi-hid driver HID layer Jingyuan Liang
2026-10-19 19:26   ` sashiko-bot
2026-10-19 19:01 ` [PATCH v6 05/11] HID: spi-hid: add HID SPI protocol implementation Jingyuan Liang
2026-10-19 19:22   ` sashiko-bot
2026-10-19 19:01 ` [PATCH v6 06/11] HID: spi-hid: add spi_hid traces Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 07/11] HID: spi-hid: add ACPI support for HID over SPI Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 08/11] dt-bindings: input: Document hid-over-spi DT schema Jingyuan Liang
2026-10-20 16:34   ` Rob Herring (Arm)
2026-10-20 17:57   ` Conor Dooley
2026-10-19 19:01 ` [PATCH v6 09/11] HID: spi-hid: add device tree support for HID over SPI Jingyuan Liang
2026-10-19 19:01 ` [PATCH v6 10/11] HID: spi-hid: add power management implementation Jingyuan Liang
2026-10-19 19:36   ` sashiko-bot
2026-10-19 19:01 ` [PATCH v6 11/11] HID: spi-hid: add panel follower support Jingyuan Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-178136@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jingyliang@chromium.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox