From 27cc2914e495d314d19c7c1f74687bb28bc292e8 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Sun, 16 Feb 2025 20:32:44 +0100 Subject: [PATCH] hwmon: (hp-wmi-sensors) Use the WMI bus API when accessing sensors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the driver already binds to HP_WMI_NUMERIC_SENSOR_GUID, using wmidev_block_query() allows for faster sensor access. Acked-by: Guenter Roeck Tested-by: James Seo Reviewed-by: James Seo Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20250216193251.866125-2-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/hwmon/hp-wmi-sensors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c index d6bdad26feb11..03c684ba83bd6 100644 --- a/drivers/hwmon/hp-wmi-sensors.c +++ b/drivers/hwmon/hp-wmi-sensors.c @@ -1197,7 +1197,7 @@ static int hp_wmi_update_info(struct hp_wmi_sensors *state, if (time_after(jiffies, info->last_updated + HZ)) { mutex_lock(&state->lock); - wobj = hp_wmi_get_wobj(HP_WMI_NUMERIC_SENSOR_GUID, instance); + wobj = wmidev_block_query(state->wdev, instance); if (!wobj) { ret = -EIO; goto out_unlock; @@ -1745,7 +1745,7 @@ static int init_numeric_sensors(struct hp_wmi_sensors *state, return -ENOMEM; for (i = 0, info = info_arr; i < icount; i++, info++) { - wobj = hp_wmi_get_wobj(HP_WMI_NUMERIC_SENSOR_GUID, i); + wobj = wmidev_block_query(state->wdev, i); if (!wobj) return -EIO;