static inline int check_format(struct v4l2_subdev *sd,
struct v4l2_subdev_format *format)
{
+ if (!format)
+ return -EINVAL;
+
return check_which(format->which) ? : check_pad(sd, format->pad);
}
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
{
+ if (!code)
+ return -EINVAL;
+
return check_which(code->which) ? : check_pad(sd, code->pad) ? :
sd->ops->pad->enum_mbus_code(sd, cfg, code);
}
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
{
+ if (!fse)
+ return -EINVAL;
+
return check_which(fse->which) ? : check_pad(sd, fse->pad) ? :
sd->ops->pad->enum_frame_size(sd, cfg, fse);
}
static inline int check_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *fi)
{
+ if (!fi)
+ return -EINVAL;
+
return check_pad(sd, fi->pad);
}
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_interval_enum *fie)
{
+ if (!fie)
+ return -EINVAL;
+
return check_which(fie->which) ? : check_pad(sd, fie->pad) ? :
sd->ops->pad->enum_frame_interval(sd, cfg, fie);
}
static inline int check_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_selection *sel)
{
+ if (!sel)
+ return -EINVAL;
+
return check_which(sel->which) ? : check_pad(sd, sel->pad);
}
static inline int check_edid(struct v4l2_subdev *sd,
struct v4l2_subdev_edid *edid)
{
+ if (!edid)
+ return -EINVAL;
+
if (edid->blocks && edid->edid == NULL)
return -EINVAL;
static int call_dv_timings_cap(struct v4l2_subdev *sd,
struct v4l2_dv_timings_cap *cap)
{
+ if (!cap)
+ return -EINVAL;
+
return check_pad(sd, cap->pad) ? :
sd->ops->pad->dv_timings_cap(sd, cap);
}
static int call_enum_dv_timings(struct v4l2_subdev *sd,
struct v4l2_enum_dv_timings *dvt)
{
+ if (!dvt)
+ return -EINVAL;
+
return check_pad(sd, dvt->pad) ? :
sd->ops->pad->enum_dv_timings(sd, dvt);
}