util.h 1015 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2013 Google, Inc
  4. */
  5. #ifndef __DM_UTIL_H
  6. #define __DM_UTIL_H
  7. #ifdef CONFIG_DM_WARN
  8. void dm_warn(const char *fmt, ...);
  9. #else
  10. static inline void dm_warn(const char *fmt, ...)
  11. {
  12. }
  13. #endif
  14. struct list_head;
  15. /**
  16. * list_count_items() - Count number of items in a list
  17. *
  18. * @param head: Head of list
  19. * @return number of items, or 0 if empty
  20. */
  21. int list_count_items(struct list_head *head);
  22. /* Dump out a tree of all devices */
  23. void dm_dump_all(void);
  24. /* Dump out a list of uclasses and their devices */
  25. void dm_dump_uclass(void);
  26. #ifdef CONFIG_DEBUG_DEVRES
  27. /* Dump out a list of device resources */
  28. void dm_dump_devres(void);
  29. #else
  30. static inline void dm_dump_devres(void)
  31. {
  32. }
  33. #endif
  34. /* Dump out a list of drivers */
  35. void dm_dump_drivers(void);
  36. /* Dump out a list with each driver's compatibility strings */
  37. void dm_dump_driver_compat(void);
  38. /* Dump out a list of drivers with static platform data */
  39. void dm_dump_static_driver_info(void);
  40. #endif