aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2014-08-13 18:20:09 +0100
committerPeter Griffin <peter.griffin@linaro.org>2014-08-13 18:20:09 +0100
commitddbaa373028e1e346ded7e165e126f82c0ff798c (patch)
tree97b2d3dcea0f701fedd9012fcd1d956432aadfbe
parent2988a4a8b6930c4b9a9d4d2384ef0d66fe35c1c2 (diff)
backlight: vgg2432a4: Don't reference zero filled structure when PM_SLEEP disabledbacklight-cleanup
By moving SIMPLE_DEV_PM_OPS declaration and reference inside the #ifdef CONFIG_PM_SLEEP, we avoid declaring and referencing a zero filled dev_pm_ops structure when CONFIG_PM_SLEEP is disabled, which reduces code size. Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r--drivers/video/backlight/vgg2432a4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/backlight/vgg2432a4.c b/drivers/video/backlight/vgg2432a4.c
index d538947a67d3..fdc6009fe0a7 100644
--- a/drivers/video/backlight/vgg2432a4.c
+++ b/drivers/video/backlight/vgg2432a4.c
@@ -214,6 +214,8 @@ static int vgg2432a4_resume(struct device *dev)
{
return ili9320_resume(dev_get_drvdata(dev));
}
+
+static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume);
#endif
static struct ili9320_client vgg2432a4_client = {
@@ -246,13 +248,13 @@ static void vgg2432a4_shutdown(struct spi_device *spi)
ili9320_shutdown(spi_get_drvdata(spi));
}
-static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume);
-
static struct spi_driver vgg2432a4_driver = {
.driver = {
.name = "VGG2432A4",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM_SLEEP
.pm = &vgg2432a4_pm_ops,
+#endif
},
.probe = vgg2432a4_probe,
.remove = vgg2432a4_remove,