media: v4l: async: Clean up testing for duplicate async subdevs
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 20 Feb 2023 11:14:19 +0000 (12:14 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 28 Jul 2023 08:39:21 +0000 (10:39 +0200)
commit506aafbad34297bdd8727e310f8ae830715159f4
tree708d32633f082da365d46124796a533bbaf539f9
parent482290390e0e961d54d0df8f3d19ff9a1f23c414
media: v4l: async: Clean up testing for duplicate async subdevs

There's a need to verify that a single async sub-device isn't being added
multiple times, this would be an error. This takes place at the time of
adding the async sub-device to the notifier's list as well as when the
notifier is added to the global notifier's list.

Use the pointer to the sub-device for testing this instead of an index to
an array that is long gone. (There was an array of async sub-devices in
the notifier before it was converted to a linked list by commit
66beb323e4a0 ("media: v4l2: async: Remove notifier subdevs array").)

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-async.c