summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/bh1780gli.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/misc/bh1780gli.c b/drivers/misc/bh1780gli.c
index c49d45fa236..060441599cb 100644
--- a/drivers/misc/bh1780gli.c
+++ b/drivers/misc/bh1780gli.c
@@ -243,6 +243,7 @@ static int __devexit bh1780_remove(struct i2c_client *client)
return 0;
}
+#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_PM)
static int bh1780_do_suspend(struct bh1780_data *ddata)
{
int ret = 0;
@@ -283,7 +284,10 @@ unlock:
mutex_unlock(&ddata->lock);
return ret;
}
-#if (!defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_PM))
+#endif
+
+#ifndef CONFIG_HAS_EARLYSUSPEND
+#ifdef CONFIG_PM
static int bh1780_suspend(struct device *dev)
{
struct bh1780_data *ddata = dev_get_drvdata(dev);
@@ -312,6 +316,7 @@ static int bh1780_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(bh1780_pm, bh1780_suspend, bh1780_resume);
#define BH1780_PMOPS (&bh1780_pm)
+#endif /* CONFIG_PM */
#else
#define BH1780_PMOPS NULL
static void bh1780_early_suspend(struct early_suspend *data)
@@ -337,7 +342,7 @@ static void bh1780_late_resume(struct early_suspend *data)
dev_err(&ddata->client->dev,
"Error while resuming the device\n");
}
-#endif /*!CONFIG_HAS_EARLYSUSPEND && CONFIG_PM */
+#endif /*!CONFIG_HAS_EARLYSUSPEND */
static const struct i2c_device_id bh1780_id[] = {
{ "bh1780", 0 },