[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04a8e024-0502-4033-8fb6-c3c8a84088fb@t-8ch.de>
Date: Wed, 21 Jan 2026 21:55:38 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>, Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>, Jonathan Corbet <corbet@....net>,
Dustin Howett <dustin@...ett.net>, Mario Limonciello <mario.limonciello@....com>,
Stephen Horvath <s.horvath@...look.com.au>, chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org, Sung-Chi Li <lschyi@...omium.org>, linux-doc@...r.kernel.org
Subject: Re: [PATCH v2 2/4] hwmon: (cros_ec) Add support for fan target speed
On 2026-01-21 09:08:26+0000, Tzung-Bi Shih wrote:
> On Sun, Jan 18, 2026 at 10:45:56AM +0100, Thomas Weißschuh wrote:
> > @@ -259,8 +278,13 @@ static umode_t cros_ec_hwmon_is_visible(const void *data, enum hwmon_sensor_type
> > u32 attr, int channel)
> > {
> > const struct cros_ec_hwmon_priv *priv = data;
> > + u16 speed;
> >
> > if (type == hwmon_fan) {
> > + if (attr == hwmon_fan_target &&
> > + cros_ec_hwmon_read_fan_target(priv->cros_ec, &speed) == -EOPNOTSUPP)
>
> [v2 4/4] patch uses is_cros_ec_cmd_available() for the purpose. Can't it
> also use here?
That is somewhat intentional. The code in patch 4 is executed many
times, so caching the result is faster. The code here is only executed
once. Calling the accessor instead of using is_cros_ec_cmd_available()
makes sure that we test for the correct command and version, without
needing another, long CROS_EC_HWMON_*_VERSION define.
Thomas
Powered by blists - more mailing lists