1*c8a311d9SSimon Glass /* 2*c8a311d9SSimon Glass * Copyright (c) 2013 The Chromium OS Authors. 3*c8a311d9SSimon Glass * 4*c8a311d9SSimon Glass * See file CREDITS for list of people who contributed to this 5*c8a311d9SSimon Glass * project. 6*c8a311d9SSimon Glass * 7*c8a311d9SSimon Glass * This program is free software; you can redistribute it and/or 8*c8a311d9SSimon Glass * modify it under the terms of the GNU General Public License as 9*c8a311d9SSimon Glass * published by the Free Software Foundation; either version 2 of 10*c8a311d9SSimon Glass * the License, or (at your option) any later version. 11*c8a311d9SSimon Glass * 12*c8a311d9SSimon Glass * This program is distributed in the hope that it will be useful, 13*c8a311d9SSimon Glass * but WITHOUT ANY WARRANTY; without even the implied warranty of 14*c8a311d9SSimon Glass * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*c8a311d9SSimon Glass * GNU General Public License for more details. 16*c8a311d9SSimon Glass * 17*c8a311d9SSimon Glass * You should have received a copy of the GNU General Public License 18*c8a311d9SSimon Glass * along with this program; if not, write to the Free Software 19*c8a311d9SSimon Glass * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20*c8a311d9SSimon Glass * MA 02111-1307 USA 21*c8a311d9SSimon Glass */ 22*c8a311d9SSimon Glass 23*c8a311d9SSimon Glass #include <common.h> 24*c8a311d9SSimon Glass #include <initcall.h> 25*c8a311d9SSimon Glass 26*c8a311d9SSimon Glass int initcall_run_list(init_fnc_t init_sequence[]) 27*c8a311d9SSimon Glass { 28*c8a311d9SSimon Glass init_fnc_t *init_fnc_ptr; 29*c8a311d9SSimon Glass 30*c8a311d9SSimon Glass for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { 31*c8a311d9SSimon Glass debug("initcall: %p\n", *init_fnc_ptr); 32*c8a311d9SSimon Glass if ((*init_fnc_ptr)()) { 33*c8a311d9SSimon Glass debug("initcall sequence %p failed at call %p\n", 34*c8a311d9SSimon Glass init_sequence, *init_fnc_ptr); 35*c8a311d9SSimon Glass return -1; 36*c8a311d9SSimon Glass } 37*c8a311d9SSimon Glass } 38*c8a311d9SSimon Glass return 0; 39*c8a311d9SSimon Glass } 40