initcall.c 483 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2013 The Chromium OS Authors.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <initcall.h>
  8. int initcall_run_list(init_fnc_t init_sequence[])
  9. {
  10. init_fnc_t *init_fnc_ptr;
  11. for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
  12. debug("initcall: %p\n", *init_fnc_ptr);
  13. if ((*init_fnc_ptr)()) {
  14. debug("initcall sequence %p failed at call %p\n",
  15. init_sequence, *init_fnc_ptr);
  16. return -1;
  17. }
  18. }
  19. return 0;
  20. }