diff mbox series

[2/8] media: sun4i_csi: Implement link validate for sun4i_csi subdev

Message ID 20240619012356.22685-3-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New
Headers show
Series media: v4l2: Improve media link validation | expand

Commit Message

Laurent Pinchart June 19, 2024, 1:23 a.m. UTC
The sun4i_csi driver doesn't implement link validation for the subdev it
registers, leaving the link between the subdev and its source
unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Chen-Yu Tsai June 22, 2024, 3:03 p.m. UTC | #1
On Wed, Jun 19, 2024 at 9:24 AM Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
>
> The sun4i_csi driver doesn't implement link validation for the subdev it
> registers, leaving the link between the subdev and its source
> unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>

> ---
>  drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
> index 097a3a08ef7d..dbb26c7b2f8d 100644
> --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
> +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
> @@ -39,6 +39,10 @@ static const struct media_entity_operations sun4i_csi_video_entity_ops = {
>         .link_validate = v4l2_subdev_link_validate,
>  };
>
> +static const struct media_entity_operations sun4i_csi_subdev_entity_ops = {
> +       .link_validate = v4l2_subdev_link_validate,
> +};
> +
>  static int sun4i_csi_notify_bound(struct v4l2_async_notifier *notifier,
>                                   struct v4l2_subdev *subdev,
>                                   struct v4l2_async_connection *asd)
> @@ -214,6 +218,7 @@ static int sun4i_csi_probe(struct platform_device *pdev)
>         subdev->internal_ops = &sun4i_csi_subdev_internal_ops;
>         subdev->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
>         subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
> +       subdev->entity.ops = &sun4i_csi_subdev_entity_ops;
>         subdev->owner = THIS_MODULE;
>         snprintf(subdev->name, sizeof(subdev->name), "sun4i-csi-0");
>         v4l2_set_subdevdata(subdev, csi);
> --
> Regards,
>
> Laurent Pinchart
>
>
Sakari Ailus June 22, 2024, 4:44 p.m. UTC | #2
Hi Laurent,

On Wed, Jun 19, 2024 at 04:23:50AM +0300, Laurent Pinchart wrote:
> The sun4i_csi driver doesn't implement link validation for the subdev it
> registers, leaving the link between the subdev and its source
> unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

This looks like a bugfix. Shouldn't this be backported?
Laurent Pinchart June 25, 2024, 9:09 p.m. UTC | #3
On Sat, Jun 22, 2024 at 04:44:15PM +0000, Sakari Ailus wrote:
> On Wed, Jun 19, 2024 at 04:23:50AM +0300, Laurent Pinchart wrote:
> > The sun4i_csi driver doesn't implement link validation for the subdev it
> > registers, leaving the link between the subdev and its source
> > unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> This looks like a bugfix. Shouldn't this be backported?

I'll add

Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
Sakari Ailus June 25, 2024, 9:49 p.m. UTC | #4
On Wed, Jun 26, 2024 at 12:09:28AM +0300, Laurent Pinchart wrote:
> On Sat, Jun 22, 2024 at 04:44:15PM +0000, Sakari Ailus wrote:
> > On Wed, Jun 19, 2024 at 04:23:50AM +0300, Laurent Pinchart wrote:
> > > The sun4i_csi driver doesn't implement link validation for the subdev it
> > > registers, leaving the link between the subdev and its source
> > > unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.
> > > 
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > 
> > This looks like a bugfix. Shouldn't this be backported?
> 
> I'll add
> 
> Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")

Please also:

Cc: stable@vger.kernel.org
Laurent Pinchart June 26, 2024, 5:50 a.m. UTC | #5
On Tue, Jun 25, 2024 at 09:49:20PM +0000, Sakari Ailus wrote:
> On Wed, Jun 26, 2024 at 12:09:28AM +0300, Laurent Pinchart wrote:
> > On Sat, Jun 22, 2024 at 04:44:15PM +0000, Sakari Ailus wrote:
> > > On Wed, Jun 19, 2024 at 04:23:50AM +0300, Laurent Pinchart wrote:
> > > > The sun4i_csi driver doesn't implement link validation for the subdev it
> > > > registers, leaving the link between the subdev and its source
> > > > unvalidated. Fix it, using the v4l2_subdev_link_validate() helper.
> > > > 
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > > 
> > > This looks like a bugfix. Shouldn't this be backported?
> > 
> > I'll add
> > 
> > Fixes: 577bbf23b758 ("media: sunxi: Add A10 CSI driver")
> 
> Please also:
> 
> Cc: stable@vger.kernel.org

Done.
diff mbox series

Patch

diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
index 097a3a08ef7d..dbb26c7b2f8d 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
+++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
@@ -39,6 +39,10 @@  static const struct media_entity_operations sun4i_csi_video_entity_ops = {
 	.link_validate = v4l2_subdev_link_validate,
 };
 
+static const struct media_entity_operations sun4i_csi_subdev_entity_ops = {
+	.link_validate = v4l2_subdev_link_validate,
+};
+
 static int sun4i_csi_notify_bound(struct v4l2_async_notifier *notifier,
 				  struct v4l2_subdev *subdev,
 				  struct v4l2_async_connection *asd)
@@ -214,6 +218,7 @@  static int sun4i_csi_probe(struct platform_device *pdev)
 	subdev->internal_ops = &sun4i_csi_subdev_internal_ops;
 	subdev->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
 	subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
+	subdev->entity.ops = &sun4i_csi_subdev_entity_ops;
 	subdev->owner = THIS_MODULE;
 	snprintf(subdev->name, sizeof(subdev->name), "sun4i-csi-0");
 	v4l2_set_subdevdata(subdev, csi);