* [3/3] usb: renesas_usbhs: Remove dummy runtime PM callbacks
@ 2018-10-24 13:51 Jarkko Nikula
0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2018-10-24 13:51 UTC (permalink / raw)
To: linux-pm
Cc: linux-i2c, Wolfram Sang, netdev, David S . Miller,
Sergei Shtylyov, linux-renesas-soc, linux-usb, Yoshihiro Shimoda,
Jarkko Nikula
Platform drivers don't need dummy runtime PM callbacks that just return
success in order to have runtime PM happening. This has changed since
following commits:
05aa55dddb9e ("PM / Runtime: Lenient generic runtime pm callbacks")
543f2503a956 ("PM / platform_bus: Allow runtime PM by default")
8b313a38ecff ("PM / Platform: Use generic runtime PM callbacks directly")
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
Only build tested.
---
drivers/usb/renesas_usbhs/common.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index a3e1290d682d..0e760f228dd8 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -874,23 +874,9 @@ static int usbhsc_resume(struct device *dev)
return 0;
}
-static int usbhsc_runtime_nop(struct device *dev)
-{
- /* Runtime PM callback shared between ->runtime_suspend()
- * and ->runtime_resume(). Simply returns success.
- *
- * This driver re-initializes all registers after
- * pm_runtime_get_sync() anyway so there is no need
- * to save and restore registers here.
- */
- return 0;
-}
-
static const struct dev_pm_ops usbhsc_pm_ops = {
.suspend = usbhsc_suspend,
.resume = usbhsc_resume,
- .runtime_suspend = usbhsc_runtime_nop,
- .runtime_resume = usbhsc_runtime_nop,
};
static struct platform_driver renesas_usbhs_driver = {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [3/3] usb: renesas_usbhs: Remove dummy runtime PM callbacks
@ 2018-10-25 2:45 Yoshihiro Shimoda
0 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2018-10-25 2:45 UTC (permalink / raw)
To: Jarkko Nikula, linux-pm@vger.kernel.org
Cc: linux-i2c@vger.kernel.org, Wolfram Sang, netdev@vger.kernel.org,
David S . Miller, Sergei Shtylyov,
linux-renesas-soc@vger.kernel.org, linux-usb@vger.kernel.org
Hi Jarkko,
> From: Jarkko Nikula, Sent: Wednesday, October 24, 2018 10:52 PM
>
> Platform drivers don't need dummy runtime PM callbacks that just return
> success in order to have runtime PM happening. This has changed since
> following commits:
>
> 05aa55dddb9e ("PM / Runtime: Lenient generic runtime pm callbacks")
> 543f2503a956 ("PM / platform_bus: Allow runtime PM by default")
> 8b313a38ecff ("PM / Platform: Use generic runtime PM callbacks directly")
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> Only build tested.
Thank you for the patch!
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> drivers/usb/renesas_usbhs/common.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index a3e1290d682d..0e760f228dd8 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -874,23 +874,9 @@ static int usbhsc_resume(struct device *dev)
> return 0;
> }
>
> -static int usbhsc_runtime_nop(struct device *dev)
> -{
> - /* Runtime PM callback shared between ->runtime_suspend()
> - * and ->runtime_resume(). Simply returns success.
> - *
> - * This driver re-initializes all registers after
> - * pm_runtime_get_sync() anyway so there is no need
> - * to save and restore registers here.
> - */
I guess this code came from i2c-sh_mobile.c or sh_eth.c
and we didn't realize this code didn't need at that time (Oct 10 2011).
Best regards,
Yoshihiro Shimoda
> - return 0;
> -}
> -
> static const struct dev_pm_ops usbhsc_pm_ops = {
> .suspend = usbhsc_suspend,
> .resume = usbhsc_resume,
> - .runtime_suspend = usbhsc_runtime_nop,
> - .runtime_resume = usbhsc_runtime_nop,
> };
>
> static struct platform_driver renesas_usbhs_driver = {
> --
> 2.19.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [3/3] usb: renesas_usbhs: Remove dummy runtime PM callbacks
@ 2018-10-25 22:57 Wolfram Sang
0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2018-10-25 22:57 UTC (permalink / raw)
To: Jarkko Nikula, Yoshihiro Shimoda
Cc: linux-pm, linux-i2c, Wolfram Sang, netdev, David S . Miller,
Sergei Shtylyov, linux-renesas-soc, linux-usb
On Wed, Oct 24, 2018 at 04:51:34PM +0300, Jarkko Nikula wrote:
> Platform drivers don't need dummy runtime PM callbacks that just return
> success in order to have runtime PM happening. This has changed since
> following commits:
>
> 05aa55dddb9e ("PM / Runtime: Lenient generic runtime pm callbacks")
> 543f2503a956 ("PM / platform_bus: Allow runtime PM by default")
> 8b313a38ecff ("PM / Platform: Use generic runtime PM callbacks directly")
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> static const struct dev_pm_ops usbhsc_pm_ops = {
> .suspend = usbhsc_suspend,
> .resume = usbhsc_resume,
Unrelated to this patch, but I wonder right now: is there a reason not
to use SET_SYSTEM_SLEEP_PM_OPS here? Shimoda-san?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [3/3] usb: renesas_usbhs: Remove dummy runtime PM callbacks
@ 2018-10-26 2:09 Yoshihiro Shimoda
0 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2018-10-26 2:09 UTC (permalink / raw)
To: Wolfram Sang, Jarkko Nikula
Cc: linux-pm@vger.kernel.org, linux-i2c@vger.kernel.org, Wolfram Sang,
netdev@vger.kernel.org, David S . Miller, Sergei Shtylyov,
linux-renesas-soc@vger.kernel.org, linux-usb@vger.kernel.org
Hi Wolfram-san,
> From: Wolfram Sang, Sent: Friday, October 26, 2018 7:58 AM
<snip>
> > static const struct dev_pm_ops usbhsc_pm_ops = {
> > .suspend = usbhsc_suspend,
> > .resume = usbhsc_resume,
>
> Unrelated to this patch, but I wonder right now: is there a reason not
> to use SET_SYSTEM_SLEEP_PM_OPS here? Shimoda-san?
I don't know why because this code is contributed from Morimoto-san.
I'm guessing this code seems to come from sh_eth.c or i2c-sh_mobile.c
and we don't have the SET_SYSTEM_SLEEP_PM_OPS macro at 2009.
Morimoto-san contributed this code at 2010, but it seems not to realize
we have such macro.
Anyway, I'll try to use SET_SYSTEM_SLEEP_PM_OPS on the renesas_usbhs driver.
Best regards,
Yoshihiro Shimoda
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-26 2:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-25 22:57 [3/3] usb: renesas_usbhs: Remove dummy runtime PM callbacks Wolfram Sang
-- strict thread matches above, loose matches on Subject: below --
2018-10-26 2:09 Yoshihiro Shimoda
2018-10-25 2:45 Yoshihiro Shimoda
2018-10-24 13:51 Jarkko Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).