]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: amd_sfh: don't log error when device discovery fails with -EOPNOTSUPP
authorMaximilian Pezzullo <maximilianpezzullo@gmail.com>
Wed, 4 Mar 2026 08:25:22 +0000 (09:25 +0100)
committerJiri Kosina <jkosina@suse.com>
Fri, 27 Mar 2026 13:08:27 +0000 (14:08 +0100)
When sensor discovery fails on systems without AMD SFH sensors, the
code already emits a warning via dev_warn() in amd_sfh_hid_client_init().
The subsequent dev_err() in sfh_init_work() for the same -EOPNOTSUPP
return value is redundant and causes unnecessary alarm.

Suppress the dev_err() for -EOPNOTSUPP to avoid confusing users who
have no AMD SFH sensors.

Fixes: 2105e8e00da4 ("HID: amd_sfh: Improve boot time when SFH is available")
Reported-by: Casey Croy <ccroy@bugzilla.kernel.org>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221099
Signed-off-by: Maximilian Pezzullo <maximilianpezzullo@gmail.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

index 1d9f955573aa4326d03d16c173ec5fab5058b5d8..4b81cebdc33590aeb003beb7613ae974dcfbbe2d 100644 (file)
@@ -413,7 +413,8 @@ static void sfh_init_work(struct work_struct *work)
        rc = amd_sfh_hid_client_init(mp2);
        if (rc) {
                amd_sfh_clear_intr(mp2);
-               dev_err(&pdev->dev, "amd_sfh_hid_client_init failed err %d\n", rc);
+               if (rc != -EOPNOTSUPP)
+                       dev_err(&pdev->dev, "amd_sfh_hid_client_init failed err %d\n", rc);
                return;
        }