Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Oleg Keri" <okerixx@gmail.com>
Cc: devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v6 2/3] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver
Date: Wed, 14 Oct 2026 13:29:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-171356@kernel.org> (raw)
In-Reply-To: <20261014132315.4659-3-okerixx@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] hwmon: registering hardware monitoring device outside drivers/hwmon/ violates layering
- [Low] i2c: struct i2c_device_id array uses positional initialization instead of named initializers
--

commit ebc39e385bee7e339220d234fab99f84ba72d285
Author: Oleg Keri <okerixx@gmail.com>

platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver

This commit adds the Lenovo Yoga Slim 7x Gen 11 embedded controller driver.
It exposes thermistors, CPU fan speed, keyboard backlight LED, hotkeys, and
an fn-lock sysfs attribute.

> diff --git a/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c
> new file mode 100644
> index 0000000000000..53b0e7b325d35
> --- /dev/null
> +++ b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c

[ ... ]

> +static int slim7x11_ec_probe(struct i2c_client *client)
> +{
> +	struct device *dev = &client->dev;
> +	struct device *hwmon;
> +	struct slim7x11_ec *ec;
> +	unsigned int i;
> +	int ret;

[ ... ]

> +	dev_dbg(dev, "thermistors present: %#lx\n", ec->temp_present);
> +
> +	hwmon = devm_hwmon_device_register_with_info(dev, "yoga_slim7x_ec", ec,
> +						     &slim7x11_ec_chip_info, NULL);

[Severity: Low]
Does this code register a hardware monitoring device directly from outside the
drivers/hwmon/ directory? 

According to the hwmon subsystem guidelines, if the main functionality of a
chip is not hardware monitoring, its hardware monitoring functionality should
be implemented as an auxiliary device driver, and the hardware monitoring
driver itself should reside in drivers/hwmon/.

> +	if (IS_ERR(hwmon))
> +		return PTR_ERR(hwmon);
> +

[ ... ]

> +static const struct of_device_id slim7x11_ec_of_match[] = {
> +	{ .compatible = "lenovo,yoga-slim7x-gen11-ec" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, slim7x11_ec_of_match);
> +
> +static const struct i2c_device_id slim7x11_ec_i2c_id[] = {
> +	{ "slim7x-gen11-ec" },

[Severity: Low]
Is this using a positional initializer?

The I2C subsystem guidelines state that initialized arrays of type
struct i2c_device_id must be declared const and use named initializers
(such as .name = "slim7x-gen11-ec").

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(i2c, slim7x11_ec_i2c_id);
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014132315.4659-1-okerixx@gmail.com?part=2

  reply	other threads:[~2026-10-14 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 13:23 [PATCH v6 0/3] platform/arm64: Lenovo Yoga Slim 7x Gen 11 embedded controller Oleg Keri
2026-10-14 13:23 ` [PATCH v6 1/3] dt-bindings: embedded-controller: add Lenovo Yoga Slim 7x Gen 11 EC Oleg Keri
2026-10-14 13:27   ` sashiko-bot
2026-10-14 13:23 ` [PATCH v6 2/3] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver Oleg Keri
2026-10-14 13:29   ` sashiko-bot [this message]
2026-10-14 14:00   ` Ilpo Järvinen
2026-10-14 13:23 ` [PATCH v6 3/3] arm64: dts: qcom: glymur-lenovo-yoga-slim7x: add the embedded controller Oleg Keri
2026-10-14 13:25   ` sashiko-bot

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-171356@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=okerixx@gmail.com \
    --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