[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXGYV5VdeI-CRIWk@google.com>
Date: Thu, 22 Jan 2026 03:24:07 +0000
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Thomas Weißschuh <linux@...ssschuh.net>
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 Wed, Jan 21, 2026 at 09:55:38PM +0100, Thomas Weißschuh wrote:
> 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.
I have no strong preference. For the patch,
Reviewed-by: Tzung-Bi Shih <tzungbi@...nel.org>
Powered by blists - more mailing lists