From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: niklas.soderlund@ragnatech.se, robh@kernel.org,
hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com,
devicetree@vger.kernel.org, pavel@ucw.cz, sre@kernel.org
Subject: [PATCH v7 11/18] v4l: async: Register sub-devices before calling bound callback
Date: Sun, 3 Sep 2017 20:49:51 +0300 [thread overview]
Message-ID: <20170903174958.27058-12-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20170903174958.27058-1-sakari.ailus@linux.intel.com>
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 <sakari.ailus@linux.intel.com>
---
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 91d04f00b4e4..70d02378b48f 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -107,13 +107,13 @@ static int v4l2_async_test_notify(struct v4l2_async_notifier *notifier,
{
int ret;
- ret = v4l2_async_notifier_call_int_op(notifier, bound, 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_int_op(notifier, bound, sd, asd);
if (ret < 0) {
- v4l2_async_notifier_call_void_op(notifier, unbind, sd, asd);
+ v4l2_device_unregister_subdev(sd);
return ret;
}
--
2.11.0
next prev parent reply other threads:[~2017-09-03 17:50 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-03 17:49 [PATCH v7 00/18] Unified fwnode endpoint parser, async sub-device notifier support, N9 flash DTS Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 01/18] v4l: fwnode: Move KernelDoc documentation to the header Sakari Ailus
2017-09-04 15:49 ` Pavel Machek
2017-09-05 14:53 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 02/18] v4l: async: Add V4L2 async documentation to the documentation build Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 03/18] docs-rst: v4l: Include Qualcomm CAMSS in " Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 04/18] v4l: fwnode: Support generic parsing of graph endpoints in a device Sakari Ailus
2017-09-04 13:19 ` Hans Verkuil
2017-09-04 15:54 ` Sakari Ailus
2017-09-04 17:37 ` Hans Verkuil
2017-09-04 20:30 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 05/18] omap3isp: Use generic parser for parsing fwnode endpoints Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 06/18] rcar-vin: " Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 07/18] omap3isp: Fix check for our own sub-devices Sakari Ailus
2017-09-04 13:28 ` Hans Verkuil
2017-09-04 16:07 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 08/18] omap3isp: Print the name of the entity where no source pads could be found Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 09/18] v4l: async: Move async subdev notifier operations to a separate structure Sakari Ailus
2017-09-04 13:48 ` Hans Verkuil
2017-09-03 17:49 ` [PATCH v7 10/18] v4l: async: Introduce macros for calling async ops callbacks Sakari Ailus
2017-09-04 13:50 ` Hans Verkuil
2017-09-04 16:09 ` Sakari Ailus
2017-09-03 17:49 ` Sakari Ailus [this message]
2017-09-08 12:28 ` [PATCH v7 11/18] v4l: async: Register sub-devices before calling bound callback Pavel Machek
2017-09-03 17:49 ` [PATCH v7 12/18] v4l: async: Allow binding notifiers to sub-devices Sakari Ailus
2017-09-04 14:56 ` Hans Verkuil
2017-09-04 16:42 ` Sakari Ailus
2017-09-05 6:49 ` Hans Verkuil
2017-09-05 8:36 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 13/18] dt: bindings: Add a binding for flash devices associated to a sensor Sakari Ailus
2017-09-04 14:31 ` Hans Verkuil
2017-09-04 16:27 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 14/18] dt: bindings: Add lens-focus binding for image sensors Sakari Ailus
2017-09-04 14:37 ` Hans Verkuil
2017-09-04 16:29 ` Sakari Ailus
2017-09-03 17:49 ` [PATCH v7 15/18] v4l2-fwnode: Add convenience function for parsing generic references Sakari Ailus
2017-09-04 14:44 ` Hans Verkuil
2017-09-04 16:34 ` Sakari Ailus
2017-09-04 17:38 ` Hans Verkuil
2017-09-03 17:49 ` [PATCH v7 16/18] v4l2-fwnode: Add convenience function for parsing common external refs Sakari Ailus
2017-09-04 14:58 ` Hans Verkuil
2017-09-03 17:49 ` [PATCH v7 17/18] smiapp: Add support for flash and lens devices Sakari Ailus
2017-09-03 20:18 ` [PATCH v7 1/1] dt: bindings: smiapp: Document lens-focus and flash properties Sakari Ailus
2017-09-08 12:28 ` Pavel Machek
2017-09-03 17:49 ` [PATCH v7 18/18] arm: dts: omap3: N9/N950: Add flash references to the camera Sakari Ailus
2017-09-04 7:47 ` [PATCH v7 00/18] Unified fwnode endpoint parser, async sub-device notifier support, N9 flash DTS Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170903174958.27058-12-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=pavel@ucw.cz \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).