SUPERH platform development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH 2/2] shdmac: extend PM methods
Date: Mon, 19 Jan 2015 23:07:59 +0000	[thread overview]
Message-ID: <7124495.gOhk31Ctg5@wasted.cogentembedded.com> (raw)

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


             reply	other threads:[~2015-01-19 23:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 23:07 Sergei Shtylyov [this message]
2015-01-20 19:41 ` [PATCH 2/2] shdmac: extend PM methods Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7124495.gOhk31Ctg5@wasted.cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox