summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2024-07-30 16:41:32 +0530
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-07-31 09:54:53 +0200
commit939afc80b6b5de23d70789f3cb3a391dd31319b1 (patch)
treefd6bf04ca23dc979e4ec580d569c95f77dd68b01 /drivers/core
parente464ad085e522d09fadd825c2a1246450ff3188c (diff)
dm: use list_count_nodes() for counting list nodes
The linux kernel has the list_count_nodes() API functions which is used for counting nodes of a list. This has now been imported in U-Boot as part of an earlier commit. Use this function and drop the list_count_items(). Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/util.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/core/util.c b/drivers/core/util.c
index 108a3bc4dac..fa893485a09 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -3,23 +3,13 @@
* Copyright (c) 2013 Google, Inc
*/
+#include <vsprintf.h>
#include <dm/device.h>
#include <dm/ofnode.h>
#include <dm/read.h>
#include <dm/util.h>
#include <linux/libfdt.h>
-#include <vsprintf.h>
-
-int list_count_items(struct list_head *head)
-{
- struct list_head *node;
- int count = 0;
-
- list_for_each(node, head)
- count++;
-
- return count;
-}
+#include <linux/list.h>
#if CONFIG_IS_ENABLED(OF_REAL)
int pci_get_devfn(struct udevice *dev)