Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value

From: Alan Stern

Date: Mon Dec 22 2025 - 15:57:42 EST


On Mon, Dec 22, 2025 at 08:52:33PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> To allow the return type of pm_runtime_put() to be changed to void in the
> future, modify usb_autopm_put_interface_async() to discard the return
> value of pm_runtime_put().
>
> That value is merely used in a debug comment printed by the function in
> question and it is not a particularly useful piece of information
> because pm_runtime_put() does not guarantee that the device will be
> suspended even if it successfully queues up a work item to check
> whether or not the device can be suspended.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

> This patch is part of a series, but it doesn't depend on anything else
> in that series. The last patch in the series depends on it.
>
> It can be applied by itself and if you decide to do so, please let me
> know.
>
> Otherwise, an ACK or equivalent will be appreciated, but also the lack
> of specific criticism will be eventually regarded as consent.
>
> ---
> drivers/usb/core/driver.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1810,13 +1810,11 @@ EXPORT_SYMBOL_GPL(usb_autopm_put_interfa
> void usb_autopm_put_interface_async(struct usb_interface *intf)
> {
> struct usb_device *udev = interface_to_usbdev(intf);
> - int status;
>
> usb_mark_last_busy(udev);
> - status = pm_runtime_put(&intf->dev);
> - dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
> - __func__, atomic_read(&intf->dev.power.usage_count),
> - status);
> + pm_runtime_put(&intf->dev);
> + dev_vdbg(&intf->dev, "%s: cnt %d\n",
> + __func__, atomic_read(&intf->dev.power.usage_count));
> }
> EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async);
>
>
>
>