Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/block/mg_disk.c: add CONFIG_PM_SLEEP to suspend/resume functions

Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build
warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM
callbacks defined by SIMPLE_DEV_PM_OPS are only used when the
CONFIG_PM_SLEEP is enabled.

drivers/block/mg_disk.c:783:12: warning: 'mg_suspend' defined but not used [-Wunused-function]
drivers/block/mg_disk.c:807:12: warning: 'mg_resume' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Jingoo Han and committed by
Jens Axboe
aed3d67e 2077d947

+2
+2
drivers/block/mg_disk.c
··· 780 780 .getgeo = mg_getgeo 781 781 }; 782 782 783 + #ifdef CONFIG_PM_SLEEP 783 784 static int mg_suspend(struct device *dev) 784 785 { 785 786 struct mg_drv_data *prv_data = dev->platform_data; ··· 825 824 826 825 return 0; 827 826 } 827 + #endif 828 828 829 829 static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume); 830 830