* [PATCH 2/2] shdmac: extend PM methods
@ 2015-01-19 23:07 Sergei Shtylyov
2015-01-20 19:41 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2015-01-19 23:07 UTC (permalink / raw)
To: linux-sh
In order to make it possible to restore from hibernation not only in Linux but
also in e.g. U-Boot, we have to use sh_dmae_{suspend|resume}() for the {freeze|
thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS()
macro; since that macro doesn't do anything when CONFIG_PM_SLEEP is undefined,
we don't need to #define sh_dmae_{suspend|resume} NULL anymore; it seems safe to
leave the #ifdef CONFIG_PM alone as this option is selected by CONFIG_PM_SLEEP
anyway...
Based on orignal patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'next' branch of Vinod Koul's 'slave-dma.git' repo.
drivers/dma/sh/shdmac.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Index: slave-dma/drivers/dma/sh/shdmac.c
=================================--- slave-dma.orig/drivers/dma/sh/shdmac.c
+++ slave-dma/drivers/dma/sh/shdmac.c
@@ -632,14 +632,10 @@ static int sh_dmae_resume(struct device
return 0;
}
-#else
-#define sh_dmae_suspend NULL
-#define sh_dmae_resume NULL
#endif
static const struct dev_pm_ops sh_dmae_pm = {
- .suspend = sh_dmae_suspend,
- .resume = sh_dmae_resume,
+ SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume)
SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume,
NULL)
};
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] shdmac: extend PM methods
2015-01-19 23:07 [PATCH 2/2] shdmac: extend PM methods Sergei Shtylyov
@ 2015-01-20 19:41 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2015-01-20 19:41 UTC (permalink / raw)
To: linux-sh
Hello.
On 01/20/2015 02:07 AM, Sergei Shtylyov wrote:
> In order to make it possible to restore from hibernation not only in Linux but
> also in e.g. U-Boot, we have to use sh_dmae_{suspend|resume}() for the {freeze|
> thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS()
> macro; since that macro doesn't do anything when CONFIG_PM_SLEEP is undefined,
> we don't need to #define sh_dmae_{suspend|resume} NULL anymore; it seems safe to
> leave the #ifdef CONFIG_PM alone as this option is selected by CONFIG_PM_SLEEP
> anyway...
However, when CONFIG_PM is defined and CONFIG_PM_SLEEP is not, we'll still
get the function unused warnings... so I'm going to recast this patch
(actually, my first variant was correct).
> Based on orignal patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
WBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-20 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 23:07 [PATCH 2/2] shdmac: extend PM methods Sergei Shtylyov
2015-01-20 19:41 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox