summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2023-02-22 12:02:39 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-07-28 10:42:20 +0200
commitb6d42c35c03dc1a0e5c2800c2137017a62ee58f9 (patch)
tree81e0ef477548a38a96b3fd589b2c33bc2e946d5c /drivers/media/v4l2-core
parent9b4d2f37484bed88fe5dfebe904df67c8bd7c24b (diff)
media: v4l: async: Clean up list heads and entries
The naming of list heads and list entries is confusing as they're named similarly. Use _list for list head and _entry for list entries. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 465eb072e7c5..04ea6f9a8ed3 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -213,7 +213,7 @@ v4l2_async_find_match(struct v4l2_async_notifier *notifier,
struct v4l2_async_match_desc *match);
struct v4l2_async_subdev *asd;
- list_for_each_entry(asd, &notifier->waiting, list) {
+ list_for_each_entry(asd, &notifier->waiting_list, waiting_entry) {
/* bus_type has been verified valid before */
switch (asd->match.type) {
case V4L2_ASYNC_MATCH_TYPE_I2C:
@@ -262,7 +262,7 @@ v4l2_async_find_subdev_notifier(struct v4l2_subdev *sd)
{
struct v4l2_async_notifier *n;
- list_for_each_entry(n, &notifier_list, list)
+ list_for_each_entry(n, &notifier_list, notifier_entry)
if (n->sd == sd)
return n;
@@ -287,10 +287,10 @@ v4l2_async_nf_can_complete(struct v4l2_async_notifier *notifier)
{
struct v4l2_subdev *sd;
- if (!list_empty(&notifier->waiting))
+ if (!list_empty(&notifier->waiting_list))
return false;
- list_for_each_entry(sd, &notifier->done, async_list) {
+ list_for_each_entry(sd, &notifier->done_list, async_list) {
struct v4l2_async_notifier *subdev_notifier =
v4l2_async_find_subdev_notifier(sd);
@@ -312,7 +312,7 @@ v4l2_async_nf_try_complete(struct v4l2_async_notifier *notifier)
struct v4l2_async_notifier *__notifier = notifier;
/* Quick check whether there are still more sub-devices here. */
- if (!list_empty(&notifier->waiting))
+ if (!list_empty(&notifier->waiting_list))
return 0;
if (notifier->sd)
@@ -391,13 +391,12 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,
return ret;
}
- /* Remove from the waiting list */
- list_del(&asd->list);
+ list_del(&asd->waiting_entry);
sd->asd = asd;
sd->notifier = notifier;
/* Move from the global subdevice list to notifier's done */
- list_move(&sd->async_list, &notifier->done);
+ list_move(&sd->async_list, &notifier->done_list);
dev_dbg(notifier_dev(notifier), "v4l2-async: %s bound (ret %d)\n",
dev_name(sd->dev), ret);
@@ -478,7 +477,7 @@ v4l2_async_nf_unbind_all_subdevs(struct v4l2_async_notifier *notifier,
{
struct v4l2_subdev *sd, *tmp;
- list_for_each_entry_safe(sd, tmp, &notifier->done, async_list) {
+ list_for_each_entry_safe(sd, tmp, &notifier->done_list, async_list) {
struct v4l2_async_notifier *subdev_notifier =
v4l2_async_find_subdev_notifier(sd);
@@ -487,7 +486,8 @@ v4l2_async_nf_unbind_all_subdevs(struct v4l2_async_notifier *notifier,
v4l2_async_nf_call_unbind(notifier, sd, sd->asd);
if (readd)
- list_add_tail(&sd->asd->list, &notifier->waiting);
+ list_add_tail(&sd->asd->waiting_entry,
+ &notifier->waiting_list);
v4l2_async_cleanup(sd);
list_move(&sd->async_list, &subdev_list);
@@ -504,11 +504,11 @@ v4l2_async_nf_has_async_match_entry(struct v4l2_async_notifier *notifier,
struct v4l2_async_subdev *asd;
struct v4l2_subdev *sd;
- list_for_each_entry(asd, &notifier->waiting, list)
+ list_for_each_entry(asd, &notifier->waiting_list, waiting_entry)
if (v4l2_async_match_equal(&asd->match, match))
return true;
- list_for_each_entry(sd, &notifier->done, async_list) {
+ list_for_each_entry(sd, &notifier->done_list, async_list) {
if (WARN_ON(!sd->asd))
continue;
@@ -535,7 +535,7 @@ v4l2_async_nf_has_async_match(struct v4l2_async_notifier *notifier,
lockdep_assert_held(&list_lock);
/* Check that an asd is not being added more than once. */
- list_for_each_entry(asd, &notifier->asd_list, asd_list) {
+ list_for_each_entry(asd, &notifier->asd_list, asd_entry) {
if (skip_self && &asd->match == match)
continue;
if (v4l2_async_match_equal(&asd->match, match))
@@ -543,7 +543,7 @@ v4l2_async_nf_has_async_match(struct v4l2_async_notifier *notifier,
}
/* Check that an asd does not exist in other notifiers. */
- list_for_each_entry(notifier, &notifier_list, list)
+ list_for_each_entry(notifier, &notifier_list, notifier_entry)
if (v4l2_async_nf_has_async_match_entry(notifier, match))
return true;
@@ -585,17 +585,17 @@ static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
struct v4l2_async_subdev *asd;
int ret;
- INIT_LIST_HEAD(&notifier->waiting);
- INIT_LIST_HEAD(&notifier->done);
+ INIT_LIST_HEAD(&notifier->waiting_list);
+ INIT_LIST_HEAD(&notifier->done_list);
mutex_lock(&list_lock);
- list_for_each_entry(asd, &notifier->asd_list, asd_list) {
+ list_for_each_entry(asd, &notifier->asd_list, asd_entry) {
ret = v4l2_async_nf_match_valid(notifier, &asd->match, true);
if (ret)
goto err_unlock;
- list_add_tail(&asd->list, &notifier->waiting);
+ list_add_tail(&asd->waiting_entry, &notifier->waiting_list);
}
ret = v4l2_async_nf_try_all_subdevs(notifier);
@@ -607,7 +607,7 @@ static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
goto err_unbind;
/* Keep also completed notifiers on the list */
- list_add(&notifier->list, &notifier_list);
+ list_add(&notifier->notifier_entry, &notifier_list);
mutex_unlock(&list_lock);
@@ -672,7 +672,7 @@ __v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
notifier->sd = NULL;
notifier->v4l2_dev = NULL;
- list_del(&notifier->list);
+ list_del(&notifier->notifier_entry);
}
void v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
@@ -692,7 +692,7 @@ static void __v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier)
if (!notifier || !notifier->asd_list.next)
return;
- list_for_each_entry_safe(asd, tmp, &notifier->asd_list, asd_list) {
+ list_for_each_entry_safe(asd, tmp, &notifier->asd_list, asd_entry) {
switch (asd->match.type) {
case V4L2_ASYNC_MATCH_TYPE_FWNODE:
fwnode_handle_put(asd->match.fwnode);
@@ -701,7 +701,7 @@ static void __v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier)
break;
}
- list_del(&asd->asd_list);
+ list_del(&asd->asd_entry);
v4l2_async_nf_call_destroy(notifier, asd);
kfree(asd);
}
@@ -729,7 +729,7 @@ static int __v4l2_async_nf_add_subdev(struct v4l2_async_notifier *notifier,
if (ret)
goto unlock;
- list_add_tail(&asd->asd_list, &notifier->asd_list);
+ list_add_tail(&asd->asd_entry, &notifier->asd_list);
unlock:
mutex_unlock(&list_lock);
@@ -827,7 +827,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
INIT_LIST_HEAD(&sd->async_list);
- list_for_each_entry(notifier, &notifier_list, list) {
+ list_for_each_entry(notifier, &notifier_list, notifier_entry) {
struct v4l2_device *v4l2_dev =
v4l2_async_nf_find_v4l2_dev(notifier);
struct v4l2_async_subdev *asd;
@@ -894,7 +894,7 @@ void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
if (sd->asd) {
struct v4l2_async_notifier *notifier = sd->notifier;
- list_add(&sd->asd->list, &notifier->waiting);
+ list_add(&sd->asd->waiting_entry, &notifier->waiting_list);
v4l2_async_nf_call_unbind(notifier, sd, sd->asd);
}
@@ -948,9 +948,9 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
mutex_lock(&list_lock);
- list_for_each_entry(notif, &notifier_list, list) {
+ list_for_each_entry(notif, &notifier_list, notifier_entry) {
seq_printf(s, "%s:\n", v4l2_async_nf_name(notif));
- list_for_each_entry(asd, &notif->waiting, list)
+ list_for_each_entry(asd, &notif->waiting_list, waiting_entry)
print_waiting_match(s, &asd->match);
}