[libcamera-devel] [PATCH 29/50] staging: media: imx: imx7-media-csi: Store imx7_csi in drv data
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue May 10 13:51:26 CEST 2022
Replace the subdev pointer stored in platform drv data with the imx7_csi
pointer. Drop a now redundant dev_set_drvdata() call.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
drivers/staging/media/imx/imx7-media-csi.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
index 14683a15e003..5a5157d8b27b 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -1842,8 +1842,6 @@ static int imx7_csi_media_dev_init(struct imx7_csi *csi)
{
int ret;
- dev_set_drvdata(csi->dev, csi);
-
strscpy(csi->mdev.model, "imx-media", sizeof(csi->mdev.model));
csi->mdev.ops = &imx7_csi_media_ops;
csi->mdev.dev = csi->dev;
@@ -1913,7 +1911,7 @@ static int imx7_csi_probe(struct platform_device *pdev)
return -ENOMEM;
csi->dev = dev;
- platform_set_drvdata(pdev, &csi->sd);
+ platform_set_drvdata(pdev, csi);
spin_lock_init(&csi->irqlock);
mutex_init(&csi->lock);
@@ -1977,14 +1975,13 @@ static int imx7_csi_probe(struct platform_device *pdev)
static int imx7_csi_remove(struct platform_device *pdev)
{
- struct v4l2_subdev *sd = platform_get_drvdata(pdev);
- struct imx7_csi *csi = v4l2_get_subdevdata(sd);
+ struct imx7_csi *csi = platform_get_drvdata(pdev);
imx7_csi_media_cleanup(csi);
v4l2_async_nf_unregister(&csi->notifier);
v4l2_async_nf_cleanup(&csi->notifier);
- v4l2_async_unregister_subdev(sd);
+ v4l2_async_unregister_subdev(&csi->sd);
mutex_destroy(&csi->lock);
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list