Hi Hans,
On Mon, Sep 04, 2017 at 03:50:52PM +0200, Hans Verkuil wrote:
On 09/03/2017 07:49 PM, Sakari Ailus wrote:
quoted
Add two macros to call async operations callbacks. Besides simplifying
callbacks, this allows async notifiers to have no ops set, i.e. it can be
left NULL.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-async.c | 19 +++++++------------
include/media/v4l2-async.h | 8 ++++++++
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 810f5e0273dc..91d04f00b4e4 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -107,16 +107,13 @@ static int v4l2_async_test_notify(struct v4l2_async_notifier *notifier,
{
int ret;
- if (notifier->ops->bound) {
- ret = notifier->ops->bound(notifier, sd, asd);
- if (ret < 0)
- return ret;
- }
+ ret = v4l2_async_notifier_call_int_op(notifier, bound, sd, asd);
Hmm, I think this is rather ugly. We only have three ops, so why not make
three macros:
v4l2_async_notifier_call_bound/unbind/complete?
Much cleaner than _int_op(...bound...).
Works for me.
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi