[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240311120309.5389-1-changhuang.liang@starfivetech.com>
Date: Mon, 11 Mar 2024 05:03:09 -0700
From: Changhuang Liang <changhuang.liang@...rfivetech.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Hans Verkuil <hverkuil-cisco@...all.nl>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Jack Zhu <jack.zhu@...rfivetech.com>,
Changhuang Liang <changhuang.liang@...rfivetech.com>,
Dan Carpenter <dan.carpenter@...aro.org>,
linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev
Subject: [v1] staging: media: starfive: Remove links when unregistering devices
Need to remove links when unregistering devices.
Fixes: ac7da4a73b10 ("media: staging: media: starfive: camss: Register devices")
Signed-off-by: Changhuang Liang <changhuang.liang@...rfivetech.com>
---
drivers/staging/media/starfive/camss/stf-camss.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/media/starfive/camss/stf-camss.c b/drivers/staging/media/starfive/camss/stf-camss.c
index a587f860101a..323aa70fdeaf 100644
--- a/drivers/staging/media/starfive/camss/stf-camss.c
+++ b/drivers/staging/media/starfive/camss/stf-camss.c
@@ -162,6 +162,12 @@ 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_isp_dev *isp_dev = &stfcamss->isp_dev;
+
+ media_entity_remove_links(&isp_dev->subdev.entity);
+ media_entity_remove_links(&cap_yuv->video.vdev.entity);
+
stf_isp_unregister(&stfcamss->isp_dev);
stf_capture_unregister(stfcamss);
}
--
2.25.1
Powered by blists - more mailing lists