From 939afc80b6b5de23d70789f3cb3a391dd31319b1 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Tue, 30 Jul 2024 16:41:32 +0530 Subject: 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 Reviewed-by: Simon Glass Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- drivers/core/util.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/core/util.c') 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 #include #include #include #include #include -#include - -int list_count_items(struct list_head *head) -{ - struct list_head *node; - int count = 0; - - list_for_each(node, head) - count++; - - return count; -} +#include #if CONFIG_IS_ENABLED(OF_REAL) int pci_get_devfn(struct udevice *dev) -- cgit v1.2.3