Browse Source

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

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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Akinobu Mita 7 years ago
parent
commit
30ed2b8334
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/media/platform/s3c-camif/camif-capture.c

+ 2 - 0
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)
 	if (camif->sensor.power_count == !on)
 		err = v4l2_subdev_call(sensor->sd, core, s_power, on);
 		err = v4l2_subdev_call(sensor->sd, core, s_power, on);
+	if (err == -ENOIOCTLCMD)
+		err = 0;
 	if (!err)
 	if (!err)
 		sensor->power_count += on ? 1 : -1;
 		sensor->power_count += on ? 1 : -1;