]> www.infradead.org Git - users/hch/misc.git/commitdiff
USB: Check no positive return values from pm_runtime_resume_and_get()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 15 Aug 2025 11:31:21 +0000 (14:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Aug 2025 10:16:26 +0000 (12:16 +0200)
pm_runtime_resume_and_get() always returns a negative error code or zero;
there's no need to check for positive values such as returned by
pm_runtime_get_sync(). Simply drop the check.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20250815113121.925641-1-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/driver.c

index 69216c3951fd9613d9e10ecd75ace8e6fb888229..25358cf3e324d623f9b32dd298e3f9f9477aa6f7 100644 (file)
@@ -1723,8 +1723,6 @@ int usb_autoresume_device(struct usb_device *udev)
        dev_vdbg(&udev->dev, "%s: cnt %d -> %d\n",
                        __func__, atomic_read(&udev->dev.power.usage_count),
                        status);
-       if (status > 0)
-               status = 0;
        return status;
 }
 
@@ -1829,8 +1827,6 @@ int usb_autopm_get_interface(struct usb_interface *intf)
        dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
                        __func__, atomic_read(&intf->dev.power.usage_count),
                        status);
-       if (status > 0)
-               status = 0;
        return status;
 }
 EXPORT_SYMBOL_GPL(usb_autopm_get_interface);