提交 184f337e 编写于 作者: A Arnd Bergmann 提交者: Vinod Koul

dmaengine: qcom-bam-dma: add __maybe_unused annotations for PM

The bam_dma driver gained runtime PM support, but that causes build
warnings whenever CONFIG_PM is disabled:

drivers/dma/qcom/bam_dma.c:1324:12: error: 'bam_dma_runtime_resume' defined but not used [-Werror=unused-function]
 static int bam_dma_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~
drivers/dma/qcom/bam_dma.c:1315:12: error: 'bam_dma_runtime_suspend' defined but not used [-Werror=unused-function]
 static int bam_dma_runtime_suspend(struct device *dev)

This removes the incomplete #ifdef guard and instead marks all
four PM functions as __maybe_unused, which avoids this kind of
warning.
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Fixes: 7d254559 ("dmaengine: qcom-bam-dma: Add pm_runtime support")
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 9a8d0efa
......@@ -1312,7 +1312,7 @@ static int bam_dma_remove(struct platform_device *pdev)
return 0;
}
static int bam_dma_runtime_suspend(struct device *dev)
static int __maybe_unused bam_dma_runtime_suspend(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
......@@ -1321,7 +1321,7 @@ static int bam_dma_runtime_suspend(struct device *dev)
return 0;
}
static int bam_dma_runtime_resume(struct device *dev)
static int __maybe_unused bam_dma_runtime_resume(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
int ret;
......@@ -1334,8 +1334,8 @@ static int bam_dma_runtime_resume(struct device *dev)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int bam_dma_suspend(struct device *dev)
static int __maybe_unused bam_dma_suspend(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
......@@ -1346,7 +1346,7 @@ static int bam_dma_suspend(struct device *dev)
return 0;
}
static int bam_dma_resume(struct device *dev)
static int __maybe_unused bam_dma_resume(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);
int ret;
......@@ -1359,7 +1359,6 @@ static int bam_dma_resume(struct device *dev)
return 0;
}
#endif
static const struct dev_pm_ops bam_dma_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(bam_dma_suspend, bam_dma_resume)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册