media: pxa_camera: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 3 Jun 2018 14:14:25 +0000 (10:14 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 5 Jun 2018 13:50:20 +0000 (09:50 -0400)
commit8cbc3a856fc6acee31f9820a566a9625776b68ee
tree1ebb94a183bbed7d00e7b0be286f1ca25e1279de
parent2b787b66bcb03ec3bd97e950464e0452f459e2ca
media: pxa_camera: 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.

Actually the -ENOIOCTLCMD is ignored in this driver's suspend/resume,
but the others treat the -ENOIOCTLCMD as an error.

This prepares a wrapper function to ignore -ENOIOCTLCMD and replaces
all s_power calls with it.

This also adds warning message when s_power() is failed.

Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/pxa_camera.c