aboutsummaryrefslogtreecommitdiff
path: root/drivers/core/devres.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core/devres.c')
-rw-r--r--drivers/core/devres.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/core/devres.c b/drivers/core/devres.c
index 9c04499..36a8b1e 100644
--- a/drivers/core/devres.c
+++ b/drivers/core/devres.c
@@ -223,6 +223,19 @@ void dm_dump_devres(void)
if (root)
dump_resources(root, 0);
}
+
+void devres_get_stats(const struct udevice *dev, struct devres_stats *stats)
+{
+ struct devres *dr;
+
+ stats->allocs = 0;
+ stats->total_size = 0;
+ list_for_each_entry(dr, &dev->devres_head, entry) {
+ stats->allocs++;
+ stats->total_size += dr->size;
+ }
+}
+
#endif
/*