Hi Jacopo, On Thu, Apr 13, 2023 at 06:58:56PM +0200, Jacopo Mondi wrote: > Hi Sakari > > On Thu, Mar 30, 2023 at 02:58:40PM +0300, Sakari Ailus wrote: > > 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. > > > > Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> > > --- > > drivers/media/v4l2-core/v4l2-async.c | 18 ++++++++---------- > > 1 file changed, 8 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > > index bb78e3618ab5..fc9ae22e2b47 100644 > > --- a/drivers/media/v4l2-core/v4l2-async.c > > +++ b/drivers/media/v4l2-core/v4l2-async.c > > @@ -456,21 +456,19 @@ __v4l2_async_nf_has_async_subdev(struct v4l2_async_notifier *notifier, > > > > /* > > * Find out whether an async sub-device was set up already or > > - * whether it exists in a given notifier before @this_index. > > - * If @this_index < 0, search the notifier's entire @asd_list. > > + * whether it exists in a given notifier. > > */ > > static bool > > v4l2_async_nf_has_async_subdev(struct v4l2_async_notifier *notifier, > > - struct v4l2_async_subdev *asd, int this_index) > > + struct v4l2_async_subdev *asd, bool skip_self) > > is skip_self used ? Yes, it should have been there. I'll add it for v2. -- Kind regards, Sakari Ailus