lkml.org 
[lkml]   [2021]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/5] usb: Use the cached ACPI _PLD entry
Date
The _PLD is now stored, so there is no need to separately
evaluate it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/core/usb-acpi.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index 50b2fc7fcc0e3..3b21c15be548f 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -176,22 +176,19 @@ usb_acpi_get_companion_for_port(struct usb_port *port_dev)
static struct acpi_device *
usb_acpi_find_companion_for_port(struct usb_port *port_dev)
{
+ struct acpi_device_location *location;
struct acpi_device *adev;
- struct acpi_pld_info *pld;
- acpi_handle *handle;
- acpi_status status;

adev = usb_acpi_get_companion_for_port(port_dev);
if (!adev)
return NULL;

- handle = adev->handle;
- status = acpi_get_physical_device_location(handle, &pld);
- if (ACPI_SUCCESS(status) && pld) {
- port_dev->location = USB_ACPI_LOCATION_VALID
- | pld->group_token << 8 | pld->group_position;
- port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
- ACPI_FREE(pld);
+ location = acpi_device_get_location(adev);
+ if (location) {
+ port_dev->location = USB_ACPI_LOCATION_VALID |
+ location->pld->group_token << 8 |
+ location->pld->group_position;
+ port_dev->connect_type = usb_acpi_get_connect_type(adev->handle, location->pld);
}

return adev;
--
2.33.0
\
 
 \ /
  Last update: 2021-12-13 11:35    [W:0.063 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site