Skip to content

Commit

Permalink
dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
Browse files Browse the repository at this point in the history
Use SET_RUNTIME_PM_OPS() to initialize the runtime PM method pointers in the
'struct dev_pm_ops';  since that macro doesn't  do anything  if CONFIG_PM is
not defined, we have  to move #ifdef up to also cover the runtime PM methods
in order to avoid compilation warnings.

Based on orignal patch by Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Sergei Shtylyov authored and Vinod Koul committed Feb 12, 2015
1 parent 0091b9d commit 82bf90c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/dma/sh/shdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ static void sh_dmae_shutdown(struct platform_device *pdev)
sh_dmae_ctl_stop(shdev);
}

#ifdef CONFIG_PM
static int sh_dmae_runtime_suspend(struct device *dev)
{
return 0;
Expand All @@ -600,7 +601,6 @@ static int sh_dmae_runtime_resume(struct device *dev)
return sh_dmae_rst(shdev);
}

#ifdef CONFIG_PM
static int sh_dmae_suspend(struct device *dev)
{
return 0;
Expand Down Expand Up @@ -640,8 +640,8 @@ static int sh_dmae_resume(struct device *dev)
static const struct dev_pm_ops sh_dmae_pm = {
.suspend = sh_dmae_suspend,
.resume = sh_dmae_resume,
.runtime_suspend = sh_dmae_runtime_suspend,
.runtime_resume = sh_dmae_runtime_resume,
SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume,
NULL)
};

static dma_addr_t sh_dmae_slave_addr(struct shdma_chan *schan)
Expand Down

0 comments on commit 82bf90c

Please sign in to comment.