Commit 92cc5158 authored by Paul Kocialkowski's avatar Paul Kocialkowski Committed by Mauro Carvalho Chehab

media: sun6i-csi: Pass and store csi device directly in video code

The video structure is part of the main csi device structure, so pass
pointers to that top-level structure directly. This makes it easier to
navigate and access other elements. No functional change intended.
Signed-off-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: default avatarMaxime Ripard <maxime@cerno.tech>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent ab2e8d5d
...@@ -706,7 +706,7 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev) ...@@ -706,7 +706,7 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
/* Video */ /* Video */
ret = sun6i_video_setup(&csi_dev->video, csi_dev); ret = sun6i_video_setup(csi_dev);
if (ret) if (ret)
goto error_v4l2_device; goto error_v4l2_device;
...@@ -735,7 +735,7 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev) ...@@ -735,7 +735,7 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
v4l2_async_nf_cleanup(notifier); v4l2_async_nf_cleanup(notifier);
error_video: error_video:
sun6i_video_cleanup(&csi_dev->video); sun6i_video_cleanup(csi_dev);
error_v4l2_device: error_v4l2_device:
v4l2_device_unregister(&v4l2->v4l2_dev); v4l2_device_unregister(&v4l2->v4l2_dev);
...@@ -756,7 +756,7 @@ static void sun6i_csi_v4l2_cleanup(struct sun6i_csi_device *csi_dev) ...@@ -756,7 +756,7 @@ static void sun6i_csi_v4l2_cleanup(struct sun6i_csi_device *csi_dev)
media_device_unregister(&v4l2->media_dev); media_device_unregister(&v4l2->media_dev);
v4l2_async_nf_unregister(&v4l2->notifier); v4l2_async_nf_unregister(&v4l2->notifier);
v4l2_async_nf_cleanup(&v4l2->notifier); v4l2_async_nf_cleanup(&v4l2->notifier);
sun6i_video_cleanup(&csi_dev->video); sun6i_video_cleanup(csi_dev);
v4l2_device_unregister(&v4l2->v4l2_dev); v4l2_device_unregister(&v4l2->v4l2_dev);
v4l2_ctrl_handler_free(&v4l2->ctrl_handler); v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
media_device_cleanup(&v4l2->media_dev); media_device_cleanup(&v4l2->media_dev);
...@@ -787,7 +787,7 @@ static irqreturn_t sun6i_csi_interrupt(int irq, void *private) ...@@ -787,7 +787,7 @@ static irqreturn_t sun6i_csi_interrupt(int irq, void *private)
} }
if (status & CSI_CH_INT_STA_FD_PD) if (status & CSI_CH_INT_STA_FD_PD)
sun6i_video_frame_done(&csi_dev->video); sun6i_video_frame_done(csi_dev);
regmap_write(regmap, CSI_CH_INT_STA_REG, status); regmap_write(regmap, CSI_CH_INT_STA_REG, status);
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
struct sun6i_csi_device; struct sun6i_csi_device;
struct sun6i_video { struct sun6i_video {
struct sun6i_csi_device *csi_dev;
struct video_device video_dev; struct video_device video_dev;
struct vb2_queue queue; struct vb2_queue queue;
struct mutex lock; /* Queue lock. */ struct mutex lock; /* Queue lock. */
...@@ -29,10 +27,9 @@ struct sun6i_video { ...@@ -29,10 +27,9 @@ struct sun6i_video {
unsigned int sequence; unsigned int sequence;
}; };
int sun6i_video_setup(struct sun6i_video *video, int sun6i_video_setup(struct sun6i_csi_device *csi_dev);
struct sun6i_csi_device *csi_dev); void sun6i_video_cleanup(struct sun6i_csi_device *csi_dev);
void sun6i_video_cleanup(struct sun6i_video *video);
void sun6i_video_frame_done(struct sun6i_video *video); void sun6i_video_frame_done(struct sun6i_csi_device *csi_dev);
#endif /* __SUN6I_VIDEO_H__ */ #endif /* __SUN6I_VIDEO_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment