diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2024-06-19 02:46:16 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2024-08-26 16:36:14 +0300 |
commit | 9bde4f7caf38df94257d2483e89f371b1a530e9a (patch) | |
tree | ae6b808ada5e53cbdf6178e71b7fcf08714d8770 | |
parent | 2dc5d5d401f5c6cecd97800ffef82e8d17d228f0 (diff) | |
download | linux-9bde4f7caf38df94257d2483e89f371b1a530e9a.tar.xz |
media: sun4i_csi: Don't use v4l2_subdev_link_validate() for video device
The v4l2_subdev_link_validate() function is a helper designed to
validate links whose sink is a subdev. When called on a link whose sink
is a video device, it only prints a warning and returns. Its usage in
the sun4i_csi driver is wrong, leaving the link from the sub4i_csi
subdev to the capture video device unvalidated.
Planned improvements to the v4l2_subdev_link_validate() function will
turn the warning into an error, breaking the sun4i_csi driver. As an
interim measure, move the warning to the sun4i_csi driver in a custom
validation handler, and drop the call to the helper.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
-rw-r--r-- | drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c index dbb26c7b2f8d..d07e980aba61 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c @@ -35,8 +35,15 @@ struct sun4i_csi_traits { bool has_isp; }; +static int sun4i_csi_video_link_validate(struct media_link *link) +{ + dev_warn_once(link->graph_obj.mdev->dev, + "Driver bug: link validation not implemented\n"); + return 0; +} + static const struct media_entity_operations sun4i_csi_video_entity_ops = { - .link_validate = v4l2_subdev_link_validate, + .link_validate = sun4i_csi_video_link_validate, }; static const struct media_entity_operations sun4i_csi_subdev_entity_ops = { |