]> git.baikalelectronics.ru Git - kernel.git/commitdiff
HID: amd_sfh: Don't show client init failed as error when discovery fails
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 12 May 2022 18:18:48 +0000 (13:18 -0500)
committerJiri Kosina <jkosina@suse.cz>
Fri, 27 May 2022 07:07:27 +0000 (09:07 +0200)
When sensor discovery fails, this means that the system doesn't have
any sensors connected and a user should only be notified at most one time.
A message is already displayed at WARN level of "failed to discover,
sensors not enabled".  It's pointless to show that the client init failed
at ERR level for the same condition.

Check the return code and don't display this message in those conditions.

Fixes: 82add33c7c4c ("HID: amd_sfh: Add support for sensor discovery")
Reported-by: David Chang <David.Chang@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

index dadc491bbf6b241f3b9f96624748fc130d18f89b..1441787a154a86951b95066d47c744e343c3f0aa 100644 (file)
@@ -327,7 +327,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
        rc = amd_sfh_hid_client_init(privdata);
        if (rc) {
                amd_sfh_clear_intr(privdata);
-               dev_err(&pdev->dev, "amd_sfh_hid_client_init failed\n");
+               if (rc != -EOPNOTSUPP)
+                       dev_err(&pdev->dev, "amd_sfh_hid_client_init failed\n");
                return rc;
        }