From mboxrd@z Thu Jan 1 00:00:00 1970 From: Niklas =?iso-8859-1?Q?S=F6derlund?= Subject: Re: [PATCH v16 15/32] v4l: async: Register sub-devices before calling bound callback Date: Thu, 26 Oct 2017 23:52:55 +0200 Message-ID: <20171026215255.GI2297@bigcity.dyn.berto.se> References: <20171026075342.5760-1-sakari.ailus@linux.intel.com> <20171026075342.5760-16-sakari.ailus@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20171026075342.5760-16-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sakari Ailus Cc: linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org, hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org, laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, pavel-+ZI9xUNit7I@public.gmane.org, sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-acpi@vger.kernel.org On 2017-10-26 10:53:25 +0300, Sakari Ailus wrote: > Register the sub-device before calling the notifier's bound callback. > Doing this the other way around is problematic as the struct v4l2_device > has not assigned for the sub-device yet and may be required by the bound > callback. > > Signed-off-by: Sakari Ailus > Acked-by: Hans Verkuil > Acked-by: Pavel Machek Acked-by: Niklas Söderlund > --- > drivers/media/v4l2-core/v4l2-async.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index e170682dae78..46db85685894 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -130,13 +130,13 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier, > { > int ret; > > - ret = v4l2_async_notifier_call_bound(notifier, sd, asd); > + ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd); > if (ret < 0) > return ret; > > - ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd); > + ret = v4l2_async_notifier_call_bound(notifier, sd, asd); > if (ret < 0) { > - v4l2_async_notifier_call_unbind(notifier, sd, asd); > + v4l2_device_unregister_subdev(sd); > return ret; > } > > -- > 2.11.0 > -- Regards, Niklas Söderlund -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html