The ->power() could be absent or not used on some platforms. This patch makes
its presence optional.

Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Cc: Sakari Ailus <sakari.ai...@iki.fi>
---
 drivers/media/video/adp1653.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
index 0fd9579..65f6f3f 100644
--- a/drivers/media/video/adp1653.c
+++ b/drivers/media/video/adp1653.c
@@ -309,6 +309,9 @@ __adp1653_set_power(struct adp1653_flash *flash, int on)
 {
        int ret;
 
+       if (flash->platform_data->power == NULL)
+               return 0;
+
        ret = flash->platform_data->power(&flash->subdev, on);
        if (ret < 0)
                return ret;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to