[PATCH 2/2] USB: Use ACPI device information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use ACPI device pld information instead of calling acpi_get_physical_device_location api

Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@xxxxxxxxx>
Acked-by: Samuel Ortiz <samuel.ortiz@xxxxxxxxx>

---
 drivers/usb/core/usb-acpi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index 5ca4070..6528372 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -87,7 +87,7 @@ static int usb_acpi_check_port_connect_type(struct usb_device *hdev,
     acpi_status status;
     struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
     union acpi_object *upc;
-    struct acpi_pld_info *pld;
+    struct acpi_device *adev;
     int ret = 0;

     /*
@@ -98,8 +98,8 @@ static int usb_acpi_check_port_connect_type(struct usb_device *hdev,
      * a usb device is directly hard-wired to the port. If no visible and
      * no connectable, the port would be not used.
      */
-    status = acpi_get_physical_device_location(handle, &pld);
-    if (ACPI_FAILURE(status))
+    acpi_bus_get_device(handle, &adev);
+    if ((!adev) || (!adev->pld))
         return -ENODEV;

     status = acpi_evaluate_object(handle, "_UPC", NULL, &buffer);
@@ -111,17 +111,16 @@ static int usb_acpi_check_port_connect_type(struct usb_device *hdev,
     }

     if (upc->package.elements[0].integer.value)
-        if (pld->user_visible)
+        if (adev->pld->user_visible)
             usb_set_hub_port_connect_type(hdev, port1,
                 USB_PORT_CONNECT_TYPE_HOT_PLUG);
         else
             usb_set_hub_port_connect_type(hdev, port1,
                 USB_PORT_CONNECT_TYPE_HARD_WIRED);
-    else if (!pld->user_visible)
+    else if (!adev->pld->user_visible)
         usb_set_hub_port_connect_type(hdev, port1, USB_PORT_NOT_USED);

 out:
-    ACPI_FREE(pld);
     kfree(upc);
     return ret;
 }
--

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux