diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-03-10 18:41:29 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-16 12:15:10 +0100 |
commit | e13a7333067e47d01f8bfcc36e300e26ab4f8bea (patch) | |
tree | 5fd98ba1ed380b0b714808295ce2bf5b568ae17e /drivers/usb/core | |
parent | f977caea50381e9ca38319037a2b23fe3209d647 (diff) | |
download | linux-e13a7333067e47d01f8bfcc36e300e26ab4f8bea.tar.gz linux-e13a7333067e47d01f8bfcc36e300e26ab4f8bea.tar.bz2 linux-e13a7333067e47d01f8bfcc36e300e26ab4f8bea.zip |
usb: acpi: Switch to use acpi_evaluate_dsm_typed()
The acpi_evaluate_dsm_typed() provides a way to check the type of the
object evaluated by _DSM call. Use it instead of open coded variant.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230310164129.21937-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/usb-acpi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index 533baa85083c..a34b22537d7c 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c @@ -81,15 +81,11 @@ int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) return -ENODEV; } - obj = acpi_evaluate_dsm(port_handle, &guid, 0, - USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); - - if (!obj) - return -ENODEV; - - if (obj->type != ACPI_TYPE_INTEGER) { + obj = acpi_evaluate_dsm_typed(port_handle, &guid, 0, + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL, + ACPI_TYPE_INTEGER); + if (!obj) { dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); - ACPI_FREE(obj); return -EINVAL; } |