media: atomisp: Allow sensor drivers without a s_power callback

The s_power callback for v4l2-subdevs has been deprecated, allow sensor
drivers without a s_power callback to work by ignoring the -ENOIOCTLCMD
return value.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Hans de Goede 2023-01-13 18:06:06 +01:00 committed by Mauro Carvalho Chehab
parent 5141562bf4
commit 3f1125db16
2 changed files with 3 additions and 3 deletions

View File

@ -832,7 +832,7 @@ static int atomisp_release(struct file *file)
if (isp->inputs[asd->input_curr].asd == asd) {
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
core, s_power, 0);
if (ret)
if (ret && ret != -ENOIOCTLCMD)
dev_warn(isp->dev, "Failed to power-off sensor\n");
/* clear the asd field to show this camera is not used */

View File

@ -700,7 +700,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
asd->input_curr != input) {
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
core, s_power, 0);
if (ret)
if (ret && ret != -ENOIOCTLCMD)
dev_warn(isp->dev,
"Failed to power-off sensor\n");
/* clear the asd field to show this camera is not used */
@ -709,7 +709,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
/* powe on the new sensor */
ret = v4l2_subdev_call(isp->inputs[input].camera, core, s_power, 1);
if (ret) {
if (ret && ret != -ENOIOCTLCMD) {
dev_err(isp->dev, "Failed to power-on sensor\n");
return ret;
}