Skip to contentSkip to conversation

USB: Check no positive return values from pm_runtime_resume_and_get()

PATCH New Sakari Ailus 1 participant 1 message Aug 15, 2025 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 USB: Check no positive return values from pm_runtime_resume_and_get()

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.

---
since v1:

- Drop Fixes: and Cc: stable tags.

 drivers/usb/core/driver.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/core/driver.c +0 -4
index c3177034b779..d4df17b3d7e7 100644
@@ -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);
Signature · 1 line
2.39.5