Commit 3f1125db authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

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: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 5141562b
...@@ -832,7 +832,7 @@ static int atomisp_release(struct file *file) ...@@ -832,7 +832,7 @@ static int atomisp_release(struct file *file)
if (isp->inputs[asd->input_curr].asd == asd) { if (isp->inputs[asd->input_curr].asd == asd) {
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
core, s_power, 0); core, s_power, 0);
if (ret) if (ret && ret != -ENOIOCTLCMD)
dev_warn(isp->dev, "Failed to power-off sensor\n"); dev_warn(isp->dev, "Failed to power-off sensor\n");
/* clear the asd field to show this camera is not used */ /* clear the asd field to show this camera is not used */
......
...@@ -700,7 +700,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input) ...@@ -700,7 +700,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
asd->input_curr != input) { asd->input_curr != input) {
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
core, s_power, 0); core, s_power, 0);
if (ret) if (ret && ret != -ENOIOCTLCMD)
dev_warn(isp->dev, dev_warn(isp->dev,
"Failed to power-off sensor\n"); "Failed to power-off sensor\n");
/* clear the asd field to show this camera is not used */ /* 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) ...@@ -709,7 +709,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
/* powe on the new sensor */ /* powe on the new sensor */
ret = v4l2_subdev_call(isp->inputs[input].camera, core, s_power, 1); 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"); dev_err(isp->dev, "Failed to power-on sensor\n");
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment