From: Armin Wolf <W_Armin@gmx.de>
To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] platform/x86: wmi: Return immediately if an suitable WMI event is found
Date: Wed, 3 Jan 2024 20:27:05 +0100 [thread overview]
Message-ID: <20240103192707.115512-3-W_Armin@gmx.de> (raw)
In-Reply-To: <20240103192707.115512-1-W_Armin@gmx.de>
Commit 58f6425eb92f ("WMI: Cater for multiple events with same GUID")
allowed legacy WMI notify handlers to be installed for multiple WMI
devices with the same GUID.
However this is useless since the legacy GUID-based interface is
blacklisted from seeing WMI devices with duplicated GUIDs.
Return immediately if a suitable WMI event is found in
wmi_install/remove_notify_handler() since searching for other suitable
events is pointless.
Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/platform/x86/wmi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 3899a5e3fca7..7470a149b254 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -572,7 +572,6 @@ acpi_status wmi_install_notify_handler(const char *guid,
void *data)
{
struct wmi_block *block;
- acpi_status status = AE_NOT_EXIST;
guid_t guid_input;
if (!guid || !handler)
@@ -595,11 +594,11 @@ acpi_status wmi_install_notify_handler(const char *guid,
if (ACPI_FAILURE(wmi_status))
dev_warn(&block->dev.dev, "Failed to enable device\n");
- status = AE_OK;
+ return AE_OK;
}
}
- return status;
+ return AE_NOT_EXIST;
}
EXPORT_SYMBOL_GPL(wmi_install_notify_handler);
@@ -614,7 +613,6 @@ EXPORT_SYMBOL_GPL(wmi_install_notify_handler);
acpi_status wmi_remove_notify_handler(const char *guid)
{
struct wmi_block *block;
- acpi_status status = AE_NOT_EXIST;
guid_t guid_input;
if (!guid)
@@ -637,11 +635,11 @@ acpi_status wmi_remove_notify_handler(const char *guid)
block->handler = NULL;
block->handler_data = NULL;
- status = AE_OK;
+ return AE_OK;
}
}
- return status;
+ return AE_NOT_EXIST;
}
EXPORT_SYMBOL_GPL(wmi_remove_notify_handler);
--
2.39.2
next prev parent reply other threads:[~2024-01-03 19:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 19:27 [PATCH 0/4] platform/x86: wmi: Event handling fixes Armin Wolf
2024-01-03 19:27 ` [PATCH 1/4] platform/x86: wmi: Fix error handling in legacy WMI notify handler functions Armin Wolf
2024-01-04 18:10 ` Ilpo Järvinen
2024-01-03 19:27 ` Armin Wolf [this message]
2024-01-04 18:13 ` [PATCH 2/4] platform/x86: wmi: Return immediately if an suitable WMI event is found Ilpo Järvinen
2024-01-03 19:27 ` [PATCH 3/4] platform/x86: wmi: Decouple legacy WMI notify handlers from wmi_block_list Armin Wolf
2024-01-04 18:14 ` Ilpo Järvinen
2024-01-03 19:27 ` [PATCH 4/4] platform/x86: wmi: Fix notify callback locking Armin Wolf
2024-01-04 18:15 ` Ilpo Järvinen
2024-01-08 14:00 ` [PATCH 0/4] platform/x86: wmi: Event handling fixes Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240103192707.115512-3-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®