Skip to content

Commit 522ef61

Browse files
arndbVinod Koul
authored andcommitted
dmaengine: cppi41: mark PM functions as __maybe_unused
When CONFIG_PM_SLEEP is disabled, we get a build error in the cppi41 dmaengine driver, since the runtime-pm functions are hidden within the wrong #ifdef: drivers/dma/cppi41.c:1158:21: error: 'cppi41_runtime_suspend' undeclared here (not in a function) This removes the #ifdef and instead uses __maybe_unused annotations that cannot have this problem. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: fdea2d0 ("dmaengine: cppi41: Add basic PM runtime support") Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1 parent fdea2d0 commit 522ef61

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/dma/cppi41.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,7 @@ static int cppi41_dma_remove(struct platform_device *pdev)
10901090
return 0;
10911091
}
10921092

1093-
#ifdef CONFIG_PM_SLEEP
1094-
static int cppi41_suspend(struct device *dev)
1093+
static int __maybe_unused cppi41_suspend(struct device *dev)
10951094
{
10961095
struct cppi41_dd *cdd = dev_get_drvdata(dev);
10971096

@@ -1102,7 +1101,7 @@ static int cppi41_suspend(struct device *dev)
11021101
return 0;
11031102
}
11041103

1105-
static int cppi41_resume(struct device *dev)
1104+
static int __maybe_unused cppi41_resume(struct device *dev)
11061105
{
11071106
struct cppi41_dd *cdd = dev_get_drvdata(dev);
11081107
struct cppi41_channel *c;
@@ -1127,7 +1126,7 @@ static int cppi41_resume(struct device *dev)
11271126
return 0;
11281127
}
11291128

1130-
static int cppi41_runtime_suspend(struct device *dev)
1129+
static int __maybe_unused cppi41_runtime_suspend(struct device *dev)
11311130
{
11321131
struct cppi41_dd *cdd = dev_get_drvdata(dev);
11331132

@@ -1136,7 +1135,7 @@ static int cppi41_runtime_suspend(struct device *dev)
11361135
return 0;
11371136
}
11381137

1139-
static int cppi41_runtime_resume(struct device *dev)
1138+
static int __maybe_unused cppi41_runtime_resume(struct device *dev)
11401139
{
11411140
struct cppi41_dd *cdd = dev_get_drvdata(dev);
11421141
struct cppi41_channel *c, *_c;
@@ -1151,7 +1150,6 @@ static int cppi41_runtime_resume(struct device *dev)
11511150

11521151
return 0;
11531152
}
1154-
#endif
11551153

11561154
static const struct dev_pm_ops cppi41_pm_ops = {
11571155
SET_LATE_SYSTEM_SLEEP_PM_OPS(cppi41_suspend, cppi41_resume)

0 commit comments

Comments
 (0)