@@ -471,14 +471,11 @@ v4l2_async_nf_has_async_match_entry(struct v4l2_async_notifier *notifier,
/*
* Find out whether an async sub-device was set up already or whether it exists
- * in a given notifier. The skip_self argument is used to skip testing the same
- * sub-device in the notifier in case the sub-device has been already added to
- * the notifier.
+ * in a given notifier.
*/
static bool
v4l2_async_nf_has_async_match(struct v4l2_async_notifier *notifier,
- struct v4l2_async_match_desc *match,
- bool skip_self)
+ struct v4l2_async_match_desc *match)
{
struct v4l2_async_connection *asc;
@@ -486,7 +483,7 @@ v4l2_async_nf_has_async_match(struct v4l2_async_notifier *notifier,
/* Check that an asd is not being added more than once. */
list_for_each_entry(asc, ¬ifier->asc_list, asc_entry) {
- if (skip_self && &asc->match == match)
+ if (&asc->match == match)
continue;
if (v4l2_async_match_equal(&asc->match, match))
return true;
@@ -501,16 +498,14 @@ v4l2_async_nf_has_async_match(struct v4l2_async_notifier *notifier,
}
static int v4l2_async_nf_match_valid(struct v4l2_async_notifier *notifier,
- struct v4l2_async_match_desc *match,
- bool skip_self)
+ struct v4l2_async_match_desc *match)
{
struct device *dev = notifier_dev(notifier);
switch (match->type) {
case V4L2_ASYNC_MATCH_TYPE_I2C:
case V4L2_ASYNC_MATCH_TYPE_FWNODE:
- if (v4l2_async_nf_has_async_match(notifier, match,
- skip_self)) {
+ if (v4l2_async_nf_has_async_match(notifier, match)) {
dev_dbg(dev, "v4l2-async: match descriptor already listed in a notifier\n");
return -EEXIST;
}
@@ -541,7 +536,7 @@ static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
mutex_lock(&list_lock);
list_for_each_entry(asc, ¬ifier->asc_list, asc_entry) {
- ret = v4l2_async_nf_match_valid(notifier, &asc->match, true);
+ ret = v4l2_async_nf_match_valid(notifier, &asc->match);
if (ret)
goto err_unlock;
@@ -670,19 +665,13 @@ EXPORT_SYMBOL_GPL(v4l2_async_nf_cleanup);
static int __v4l2_async_nf_add_connection(struct v4l2_async_notifier *notifier,
struct v4l2_async_connection *asc)
{
- int ret;
-
mutex_lock(&list_lock);
- ret = v4l2_async_nf_match_valid(notifier, &asc->match, false);
- if (ret)
- goto unlock;
-
list_add_tail(&asc->asc_entry, ¬ifier->asc_list);
-unlock:
mutex_unlock(&list_lock);
- return ret;
+
+ return 0;
}
struct v4l2_async_connection *