回复: [PATCH v1 5/7] staging: media: starfive: Add ISP raw video device

Changhuang Liang
2024-03-07T02:13:53Z

Hi, Dan

[...]
> >
> > +err_rm_links0:
> > + media_entity_remove_links(&isp_dev->subdev.entity);
>
> I don't think this line is correct. I think we only need to remove
> &cap_yuv->video.vdev.entity.
>

The instance I refer to needs to clear both the source entity and the sink entity. See
https://elixir.bootlin.com/linux/v6.8-rc7/source/drivers/media/platform/verisilicon/hantro_drv.c#L855

> > + media_entity_remove_links(&cap_yuv->video.vdev.entity);
> > err_cap_unregister:
> > stf_capture_unregister(stfcamss);
> > err_isp_unregister:
> > @@ -162,6 +173,14 @@ static int stfcamss_register_devs(struct stfcamss
> > *stfcamss)
> >
> > static void stfcamss_unregister_devs(struct stfcamss *stfcamss) {
> > + struct stf_capture *cap_yuv =
> &stfcamss->captures[STF_CAPTURE_YUV];
> > + struct stf_capture *cap_raw =
> &stfcamss->captures[STF_CAPTURE_RAW];
> > + struct stf_isp_dev *isp_dev = &stfcamss->isp_dev;
> > +
> > + media_entity_remove_links(&isp_dev->subdev.entity);
>
> I think this line should be deleted.
>
> > + media_entity_remove_links(&cap_raw->video.vdev.entity);
> > + media_entity_remove_links(&cap_yuv->video.vdev.entity);
>
> I think this "&cap_yuv" should be submitted by itself as a bugfix patch.
>

Yes.

Regards
Changhuang