{
struct v4l2_ctrl *ctrl;
+ if (!ctx->sensor)
+ return -ENODEV;
+
ctrl = v4l2_ctrl_find(ctx->sensor->ctrl_handler, V4L2_CID_PIXEL_RATE);
if (!ctrl) {
ctx_err(ctx, "no pixel rate control in subdev: %s\n",
struct v4l2_mbus_framefmt *mbus_fmt = &sd_fmt.format;
int ret;
- if (!ctx->sensor)
- return -EINVAL;
-
sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
sd_fmt.pad = 0;
struct v4l2_mbus_framefmt *mbus_fmt = &sd_fmt.format;
int ret;
- if (!ctx->sensor)
- return -EINVAL;
-
sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
sd_fmt.pad = 0;
*mbus_fmt = *fmt;
ret = v4l2_subdev_call(ctx->sensor, pad, enum_frame_size, NULL, &fse);
if (ret)
- return -EINVAL;
+ return ret;
ctx_dbg(1, ctx, "%s: index: %d code: %x W:[%d,%d] H:[%d,%d]\n",
__func__, fse.index, fse.code, fse.min_width, fse.max_width,
cal_wr_dma_addr(ctx, addr);
csi2_ppi_enable(ctx);
- if (ctx->sensor) {
- if (v4l2_subdev_call(ctx->sensor, video, s_stream, 1)) {
- ctx_err(ctx, "stream on failed in subdev\n");
- cal_runtime_put(ctx->dev);
- ret = -EINVAL;
- goto err;
- }
+ ret = v4l2_subdev_call(ctx->sensor, video, s_stream, 1);
+ if (ret) {
+ ctx_err(ctx, "stream on failed in subdev\n");
+ cal_runtime_put(ctx->dev);
+ goto err;
}
if (debug >= 4)
struct cal_buffer *buf, *tmp;
unsigned long flags;
- if (ctx->sensor) {
- if (v4l2_subdev_call(ctx->sensor, video, s_stream, 0))
- ctx_err(ctx, "stream off failed in subdev\n");
- }
+ if (v4l2_subdev_call(ctx->sensor, video, s_stream, 0))
+ ctx_err(ctx, "stream off failed in subdev\n");
csi2_ppi_disable(ctx);
disable_irqs(ctx);