[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2503491.Lt9SDvczpP@kreacher>
Date: Tue, 12 Oct 2021 21:32:04 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Linux ACPI <linux-acpi@...r.kernel.org>,
Maximilian Luz <luzmaximilian@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <mgross@...ux.intel.com>,
platform-driver-x86@...r.kernel.org
Subject: [PATCH v2 5/7] surface: surface3_power: Drop redundant acpi_bus_get_device() call
From: Rafael J. Wysocki <rafael@...nel.org>
If the ACPI companion of a given device is not present, the result
of the ACPI_HANDLE() evaluation for it will be NULL, so calling
acpi_bus_get_device() on ACPI_HANDLE() result in order to validate
it is redundant.
Drop the redundant acpi_bus_get_device() call from mshw0011_notify()
along with a local variable related to it.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael@...nel.org>
---
v1 -> v2:
* Instead of switching over to using ACPI_COMPANION(), just drop the
redundant acpi_bus_get_device() call from mshw0011_notify() and
update the subject and changelog accordingly.
---
drivers/platform/surface/surface3_power.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-pm/drivers/platform/surface/surface3_power.c
===================================================================
--- linux-pm.orig/drivers/platform/surface/surface3_power.c
+++ linux-pm/drivers/platform/surface/surface3_power.c
@@ -159,12 +159,11 @@ mshw0011_notify(struct mshw0011_data *cd
unsigned int *ret_value)
{
union acpi_object *obj;
- struct acpi_device *adev;
acpi_handle handle;
unsigned int i;
handle = ACPI_HANDLE(&cdata->adp1->dev);
- if (!handle || acpi_bus_get_device(handle, &adev))
+ if (!handle)
return -ENODEV;
obj = acpi_evaluate_dsm_typed(handle, &mshw0011_guid, arg1, arg2, NULL,
Powered by blists - more mailing lists