diff mbox

media: s3c-camif: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power

Message ID 1528645321-19020-1-git-send-email-akinobu.mita@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Akinobu Mita June 10, 2018, 3:42 p.m. UTC
When the subdevice doesn't provide s_power core ops callback, the
v4l2_subdev_call for s_power returns -ENOIOCTLCMD.  If the subdevice
doesn't have the special handling for its power saving mode, the s_power
isn't required.  So -ENOIOCTLCMD from the v4l2_subdev_call should be
ignored.

Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 drivers/media/platform/s3c-camif/camif-capture.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sylwester Nawrocki June 10, 2018, 6:35 p.m. UTC | #1
On 06/10/2018 05:42 PM, Akinobu Mita wrote:
> When the subdevice doesn't provide s_power core ops callback, the
> v4l2_subdev_call for s_power returns -ENOIOCTLCMD.  If the subdevice
> doesn't have the special handling for its power saving mode, the s_power
> isn't required.  So -ENOIOCTLCMD from the v4l2_subdev_call should be
> ignored.

> Signed-off-by: Akinobu Mita<akinobu.mita@gmail.com>

Acked-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
diff mbox

Patch

diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index 9ab8e7e..b1d9f38 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -117,6 +117,8 @@  static int sensor_set_power(struct camif_dev *camif, int on)
 
 	if (camif->sensor.power_count == !on)
 		err = v4l2_subdev_call(sensor->sd, core, s_power, on);
+	if (err == -ENOIOCTLCMD)
+		err = 0;
 	if (!err)
 		sensor->power_count += on ? 1 : -1;