media: stm32: dcmipp: use v4l2_subdev_is_streaming

Rely on v4l2_subdev_is_streaming in order to know if the subdev
is streaming or not instead of relying on a local variable.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
Alain Volmat 2024-12-12 10:17:28 +01:00 committed by Hans Verkuil
parent dcb0f4c16b
commit 255e0cc62b
2 changed files with 2 additions and 9 deletions

View File

@ -78,7 +78,6 @@ struct dcmipp_byteproc_device {
struct v4l2_subdev sd;
struct device *dev;
void __iomem *regs;
bool streaming;
};
static const struct v4l2_mbus_framefmt fmt_default = {
@ -239,11 +238,10 @@ static int dcmipp_byteproc_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{
struct dcmipp_byteproc_device *byteproc = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *mf;
struct v4l2_rect *crop, *compose;
if (byteproc->streaming)
if (v4l2_subdev_is_streaming(sd))
return -EBUSY;
mf = v4l2_subdev_state_get_format(sd_state, fmt->pad);
@ -495,8 +493,6 @@ static int dcmipp_byteproc_s_stream(struct v4l2_subdev *sd, int enable)
}
}
byteproc->streaming = enable;
return 0;
}

View File

@ -129,7 +129,6 @@ struct dcmipp_par_device {
struct v4l2_subdev sd;
struct device *dev;
void __iomem *regs;
bool streaming;
};
static const struct v4l2_mbus_framefmt fmt_default = {
@ -230,7 +229,7 @@ static int dcmipp_par_set_fmt(struct v4l2_subdev *sd,
struct dcmipp_par_device *par = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *mf;
if (par->streaming)
if (v4l2_subdev_is_streaming(sd))
return -EBUSY;
mf = v4l2_subdev_state_get_format(sd_state, fmt->pad);
@ -370,8 +369,6 @@ static int dcmipp_par_s_stream(struct v4l2_subdev *sd, int enable)
reg_clear(par, DCMIPP_PRCR, DCMIPP_PRCR_ENABLE);
}
par->streaming = enable;
return ret;
}