linux/drivers/media
Laurent Pinchart d1307671e5 media: v4l2-subdev: Refactor warnings in v4l2_subdev_link_validate()
The v4l2_subdev_link_validate() function prints a one-time warning if it
gets called on a link whose source or sink is not a subdev. As links get
validated in the context of their sink, a call to the helper when the
link's sink is not a subdev indicates that the driver has set its
.link_validate() handler to v4l2_subdev_link_validate() on a non-subdev
entity, which is a clear driver bug. On the other hand, the link's
source not being a subdev indicates that the helper is used for a subdev
connected to a video output device, which is a lesser issue, if only
because this is currently common practice.

There are no drivers left in the kernel that use
v4l2_subdev_link_validate() in a context where it may get called on a
non-subdev sink. Replace the pr_warn_once() with a WARN_ON_ONCE() in
this case to make sure that new offenders won't be introduced.

A subsequent change will improve the v4l2_subdev_link_validate() helper
to properly support validating video device to subdev links.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-08-26 16:36:14 +03:00
..
cec media: cec: cec-adap.c: improve CEC_MSG_FL_REPLY_VENDOR_ID check 2024-08-08 15:24:03 +02:00
common media: videobuf2-core: attach once if multiple planes share the same dbuf 2024-08-14 10:05:32 +02:00
dvb-core media: dvbdev: Initialize sbuf 2024-04-08 13:48:19 +02:00
dvb-frontends drivers: media: dvb-frontends/rtl2830: fix an out-of-bounds write error 2024-08-09 07:56:38 +02:00
firewire media: firewire: firedtv-avc.c: replace BUG with proper, error return 2023-08-10 07:58:37 +02:00
i2c media: i2c: tda1997x: constify snd_soc_component_driver struct 2024-08-09 07:56:38 +02:00
mc media: mc: mark the media devnode as registered from the, start 2024-04-22 11:41:04 +02:00
mmc media: mmc: siano: simplify module initialization 2024-04-08 13:48:19 +02:00
pci media: mgb4: Fixed signal frame rate limit handling 2024-08-14 10:05:31 +02:00
platform media: sun4i_csi: Don't use v4l2_subdev_link_validate() for video device 2024-08-26 16:36:14 +03:00
radio media: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-08-09 07:56:37 +02:00
rc media: rc: remove unused tx_resolution field 2024-07-31 11:21:56 +02:00
spi media: gs1662: remove unused struct 'gs_reg_fmt_custom' 2024-05-31 13:51:16 +02:00
test-drivers media: vicodec: allow en/decoder cmd w/o CAPTURE 2024-08-25 08:15:24 +02:00
tuners Revert "media: tuners: fix error return code of hybrid_tuner_request_state()" 2024-08-09 07:56:38 +02:00
usb media: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-08-09 07:56:37 +02:00
v4l2-core media: v4l2-subdev: Refactor warnings in v4l2_subdev_link_validate() 2024-08-26 16:36:14 +03:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00