[PATCHv2] adp1653: make ->power() method optional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Cc: Sakari Ailus <sakari.ailus@xxxxxx>
---
 drivers/media/video/adp1653.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
index 0fd9579..f830313 100644
--- a/drivers/media/video/adp1653.c
+++ b/drivers/media/video/adp1653.c
@@ -329,6 +329,11 @@ adp1653_set_power(struct v4l2_subdev *subdev, int on)
 	struct adp1653_flash *flash = to_adp1653_flash(subdev);
 	int ret = 0;
 
+	/* There is no need to switch power in case of absence ->power()
+	 * method. */
+	if (flash->platform_data->power == NULL)
+		return 0;
+
 	mutex_lock(&flash->power_lock);
 
 	/* If the power count is modified from 0 to != 0 or from != 0 to 0,
-- 
1.7.5.4

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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux