[PATCH 3/5] mg_disk: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

From: Yuanhan Liu
Date: Tue Oct 16 2012 - 10:59:32 EST


This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Cc: "Rafael J. Wysocki" <rjw@xxxxxxx>
Cc: Jens Axboe <jaxboe@xxxxxxxxxxxx>
Signed-off-by: Yuanhan Liu <yuanhan.liu@xxxxxxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
drivers/block/mg_disk.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 1788f491..532bb89 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -780,6 +780,7 @@ static const struct block_device_operations mg_disk_ops = {
.getgeo = mg_getgeo
};

+#ifdef CONFIG_PM_SLEEP
static int mg_suspend(struct device *dev)
{
struct mg_drv_data *prv_data = dev->platform_data;
@@ -824,6 +825,7 @@ static int mg_resume(struct device *dev)

return 0;
}
+#endif

static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume);

--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/