提交 6a4f0623 编写于 作者: M Muralidharan Karicheri 提交者: Mauro Carvalho Chehab

V4L/DVB: V4L - vpfe capture - fix for kernel crash

As part of upstream merge, set_params() function was removed from isif.c.
This requires removal of BUG_ON() and check for set_params ptr in
vpfe_capture.c. Without this kernel crash dump is seen while bootup on DM365

Also made following changes:-

 1) converted error messages to debug messages since it is not right to flood
    the console with error messages for user mistakes.
 2) returns -EINVAL if ioctl is not supported
Signed-off-by: NMuralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f8f73d01
......@@ -223,7 +223,6 @@ int vpfe_register_ccdc_device(struct ccdc_hw_device *dev)
BUG_ON(!dev->hw_ops.get_frame_format);
BUG_ON(!dev->hw_ops.get_pixel_format);
BUG_ON(!dev->hw_ops.set_pixel_format);
BUG_ON(!dev->hw_ops.set_params);
BUG_ON(!dev->hw_ops.set_image_window);
BUG_ON(!dev->hw_ops.get_image_window);
BUG_ON(!dev->hw_ops.get_line_length);
......@@ -1689,11 +1688,12 @@ static long vpfe_param_handler(struct file *file, void *priv,
struct vpfe_device *vpfe_dev = video_drvdata(file);
int ret = 0;
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_param_handler\n");
v4l2_dbg(2, debug, &vpfe_dev->v4l2_dev, "vpfe_param_handler\n");
if (vpfe_dev->started) {
/* only allowed if streaming is not started */
v4l2_err(&vpfe_dev->v4l2_dev, "device already started\n");
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"device already started\n");
return -EBUSY;
}
......@@ -1705,16 +1705,23 @@ static long vpfe_param_handler(struct file *file, void *priv,
case VPFE_CMD_S_CCDC_RAW_PARAMS:
v4l2_warn(&vpfe_dev->v4l2_dev,
"VPFE_CMD_S_CCDC_RAW_PARAMS: experimental ioctl\n");
ret = ccdc_dev->hw_ops.set_params(param);
if (ret) {
v4l2_err(&vpfe_dev->v4l2_dev,
"Error in setting parameters in CCDC\n");
goto unlock_out;
}
if (vpfe_get_ccdc_image_format(vpfe_dev, &vpfe_dev->fmt) < 0) {
v4l2_err(&vpfe_dev->v4l2_dev,
"Invalid image format at CCDC\n");
goto unlock_out;
if (ccdc_dev->hw_ops.set_params) {
ret = ccdc_dev->hw_ops.set_params(param);
if (ret) {
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"Error setting parameters in CCDC\n");
goto unlock_out;
}
if (vpfe_get_ccdc_image_format(vpfe_dev,
&vpfe_dev->fmt) < 0) {
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"Invalid image format at CCDC\n");
goto unlock_out;
}
} else {
ret = -EINVAL;
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"VPFE_CMD_S_CCDC_RAW_PARAMS not supported\n");
}
break;
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册