aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-03-21 22:09:01 -0400
committerBryan Wu <cooloney@gmail.com>2013-04-01 14:04:53 -0400
commitcceba0e4b8f41a495dc7a5ab2795dcab0ddb64c1 (patch)
tree973e90514da3ffc948d0f8344d8508233f2af3ad
parent81f2a5b4a0570a662efd629c176fc1d67e56f7e3 (diff)
leds: leds-bd2802: 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/leds/leds-bd2802.c:766:12: warning: 'bd2802_suspend' defined but not used [-Wunused-function] drivers/leds/leds-bd2802.c:776:12: warning: 'bd2802_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
-rw-r--r--drivers/leds/leds-bd2802.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 9f9177d29ed7..2db04231a792 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -747,8 +747,7 @@ static int bd2802_remove(struct i2c_client *client)
747 return 0; 747 return 0;
748} 748}
749 749
750#ifdef CONFIG_PM 750#ifdef CONFIG_PM_SLEEP
751
752static void bd2802_restore_state(struct bd2802_led *led) 751static void bd2802_restore_state(struct bd2802_led *led)
753{ 752{
754 int i; 753 int i;
@@ -785,12 +784,9 @@ static int bd2802_resume(struct device *dev)
785 784
786 return 0; 785 return 0;
787} 786}
787#endif
788 788
789static SIMPLE_DEV_PM_OPS(bd2802_pm, bd2802_suspend, bd2802_resume); 789static SIMPLE_DEV_PM_OPS(bd2802_pm, bd2802_suspend, bd2802_resume);
790#define BD2802_PM (&bd2802_pm)
791#else /* CONFIG_PM */
792#define BD2802_PM NULL
793#endif
794 790
795static const struct i2c_device_id bd2802_id[] = { 791static const struct i2c_device_id bd2802_id[] = {
796 { "BD2802", 0 }, 792 { "BD2802", 0 },
@@ -801,7 +797,7 @@ MODULE_DEVICE_TABLE(i2c, bd2802_id);
801static struct i2c_driver bd2802_i2c_driver = { 797static struct i2c_driver bd2802_i2c_driver = {
802 .driver = { 798 .driver = {
803 .name = "BD2802", 799 .name = "BD2802",
804 .pm = BD2802_PM, 800 .pm = &bd2802_pm,
805 }, 801 },
806 .probe = bd2802_probe, 802 .probe = bd2802_probe,
807 .remove = bd2802_remove, 803 .remove = bd2802_remove,