public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
       [not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
@ 2025-12-22 19:52 ` Rafael J. Wysocki
  2025-12-22 20:57   ` Alan Stern
  2025-12-23  7:56   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-12-22 19:52 UTC (permalink / raw)
  To: Linux PM
  Cc: LKML, Ulf Hansson, Brian Norris, Greg Kroah-Hartman, linux-usb,
	Alan Stern

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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@intel.com>
---

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);
 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
  2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
@ 2025-12-22 20:57   ` Alan Stern
  2025-12-23  7:56   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Stern @ 2025-12-22 20:57 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, Greg Kroah-Hartman,
	linux-usb

On Mon, Dec 22, 2025 at 08:52:33PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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@intel.com>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

> 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);
>  
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value
  2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
  2025-12-22 20:57   ` Alan Stern
@ 2025-12-23  7:56   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2025-12-23  7:56 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, LKML, Ulf Hansson, Brian Norris, linux-usb, Alan Stern

On Mon, Dec 22, 2025 at 08:52:33PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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@intel.com>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-23  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <6245770.lOV4Wx5bFT@rafael.j.wysocki>
2025-12-22 19:52 ` [PATCH v1 02/23] USB: core: Discard pm_runtime_put() return value Rafael J. Wysocki
2025-12-22 20:57   ` Alan Stern
2025-12-23  7:56   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox