* [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails
@ 2022-05-12 18:18 Mario Limonciello
2022-05-12 18:21 ` Basavaraj Natikar
2022-05-27 7:07 ` Jiri Kosina
0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2022-05-12 18:18 UTC (permalink / raw)
To: jikos
Cc: basavaraj.natikar, linux-input, linux-kernel, Mario Limonciello,
David Chang
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: b5d7f43e97da ("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>
---
v1->v2:
* fix some fat finger typos in commit message
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index dadc491bbf6b..1441787a154a 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -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;
}
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails
2022-05-12 18:18 [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails Mario Limonciello
@ 2022-05-12 18:21 ` Basavaraj Natikar
2022-05-27 7:07 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Basavaraj Natikar @ 2022-05-12 18:21 UTC (permalink / raw)
To: Mario Limonciello, jikos
Cc: basavaraj.natikar, linux-input, linux-kernel, David Chang
On 5/12/2022 11:48 PM, Mario Limonciello wrote:
> 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: b5d7f43e97da ("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>
> ---
> v1->v2:
> * fix some fat finger typos in commit message
>
> drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> index dadc491bbf6b..1441787a154a 100644
> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> @@ -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;
> }
>
Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Thanks,
Basavaraj
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails
2022-05-12 18:18 [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails Mario Limonciello
2022-05-12 18:21 ` Basavaraj Natikar
@ 2022-05-27 7:07 ` Jiri Kosina
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2022-05-27 7:07 UTC (permalink / raw)
To: Mario Limonciello
Cc: basavaraj.natikar, linux-input, linux-kernel, David Chang
On Thu, 12 May 2022, Mario Limonciello wrote:
> 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: b5d7f43e97da ("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>
> ---
> v1->v2:
> * fix some fat finger typos in commit message
>
> drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> index dadc491bbf6b..1441787a154a 100644
> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> @@ -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;
Applied, thank you.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-27 7:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 18:18 [PATCH v2] HID: amd_sfh: Don't show client init failed as error when discovery fails Mario Limonciello
2022-05-12 18:21 ` Basavaraj Natikar
2022-05-27 7:07 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®