platform/x86: asus-wmi: Don't warn when fan curve method is unsupported
PATCH 1/1 platform/x86: asus-wmi: Don't warn when fan curve method is unsupported
fan_curve_check_present() probes for fan curve support by calling fan_curve_get_factory_default(). On devices whose firmware does not implement the fan curve WMI methods (e.g. the ASUS-built Intel NUC15CRHU5), the underlying asus_wmi_evaluate_method_buf() returns -ENODEV, which fan_curve_get_factory_default() reports with pr_warn() on every boot:
asus_wmi: fan_curve_get_factory_default (0x00110024) failed: -19
asus_wmi: fan_curve_get_factory_default (0x00110025) failed: -19
asus_wmi: fan_curve_get_factory_default (0x00110032) failed: -19
This is a normal, expected condition: the caller already handles the absence gracefully, and asus_wmi_evaluate_method_buf() already logs the unsupported method at pr_debug() level. Suppress the warning for -ENODEV while keeping it for genuine failures.
--- drivers/platform/x86/asus-wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +2 -1
@@ -3538,7 +3538,8 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) err =asus_wmi_evaluate_method_buf (asus->dsts_id, fan_dev, mode, buf,FAN_CURVE_BUF_LEN );if (err) { -pr_warn ("%s (0x%08x) failed: %d\n" , __func__, fan_dev, err); +if (err != -ENODEV ) +pr_warn ("%s (0x%08x) failed: %d\n" , __func__, fan_dev, err);return err; }
Signature · 1 line
2.43.0
Hi,
This duplicates an earlier patch by Armandas Kvietkus:
https://lore.kernel.org/all/[email protected]/
I missed it before sending, sorry for the noise. Ilpo already reviewed that patch and suggested using pr_debug() instead, so please disregard this patch.
Thanks,
HyeongJun