Commit 6e27ef31 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: ar0521: Refuse unsupported controls

Refuse unsupported controls by returning -EINVAL in the s_ctrl
operation. While at it, remove a the default switch case in the first
switch as it effectively is now a no-op.
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 3a51fd71
......@@ -514,9 +514,6 @@ static int ar0521_s_ctrl(struct v4l2_ctrl *ctrl)
sensor->total_height = sensor->fmt.width +
sensor->ctrls.vblank->val;
break;
default:
ret = -EINVAL;
break;
}
/* access the sensor only if it's powered up */
......@@ -546,6 +543,11 @@ static int ar0521_s_ctrl(struct v4l2_ctrl *ctrl)
ret = ar0521_write_reg(sensor, AR0521_REG_TEST_PATTERN_MODE,
ctrl->val);
break;
default:
dev_err(&sensor->i2c_client->dev,
"Unsupported control %x\n", ctrl->id);
ret = -EINVAL;
break;
}
pm_runtime_put(&sensor->i2c_client->dev);
......
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