All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gwendal Grignou <gwendal@chromium.org>
To: hdegoede@redhat.com
Cc: platform-driver-x86@vger.kernel.org,
	Gwendal Grignou <gwendal@chromium.org>
Subject: [PATCH 1/2] platform/x86: intel-vbtn: Use acpi_has_method to check for switch
Date: Fri, 29 Mar 2024 07:32:05 -0700	[thread overview]
Message-ID: <20240329143206.2977734-2-gwendal@chromium.org> (raw)
In-Reply-To: <20240329143206.2977734-1-gwendal@chromium.org>

To mimic how we check if the device has virtual buttons,
acpi_has_method(..."VBDL"), use the same method for checking virtual
switch presence.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 drivers/platform/x86/intel/vbtn.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/platform/x86/intel/vbtn.c b/drivers/platform/x86/intel/vbtn.c
index 084c355c86f5f..48f0ac19d6ddf 100644
--- a/drivers/platform/x86/intel/vbtn.c
+++ b/drivers/platform/x86/intel/vbtn.c
@@ -258,9 +258,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
 
 static bool intel_vbtn_has_switches(acpi_handle handle, bool dual_accel)
 {
-	unsigned long long vgbs;
-	acpi_status status;
-
 	/* See dual_accel_detect.h for more info */
 	if (dual_accel)
 		return false;
@@ -268,8 +265,7 @@ static bool intel_vbtn_has_switches(acpi_handle handle, bool dual_accel)
 	if (!dmi_check_system(dmi_switches_allow_list))
 		return false;
 
-	status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs);
-	return ACPI_SUCCESS(status);
+	return acpi_has_method(handle, "VGBS");
 }
 
 static int intel_vbtn_probe(struct platform_device *device)
-- 
2.44.0.478.gd926399ef9-goog


  reply	other threads:[~2024-03-29 14:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 14:32 [PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state Gwendal Grignou
2024-03-29 14:32 ` Gwendal Grignou [this message]
2024-03-29 18:49   ` [PATCH 1/2] platform/x86: intel-vbtn: Use acpi_has_method to check for switch Kuppuswamy Sathyanarayanan
2024-04-08 15:44     ` Ilpo Järvinen
2024-03-29 14:32 ` [PATCH 2/2] platform/x86: intel-vbtn: Update tablet mode switch at end of probe Gwendal Grignou
2024-03-29 18:50   ` Kuppuswamy Sathyanarayanan
2024-04-08 13:17 ` [PATCH 0/2] platform/x86: intel-vbtn: Fix ASUS VivoBook boot state 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=20240329143206.2977734-2-gwendal@chromium.org \
    --to=gwendal@chromium.org \
    --cc=hdegoede@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.