Provide weak empty declarations of all chip_ops used on a board

sconfig creates empty defaults for all chip_ops, which can be overridden
by drivers simply by providing a concrete implementation.

Change-Id: Ib37515f0b0747bdbf4da780d28690a1e719944b2
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1567
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi
2012-10-07 22:04:52 +02:00
committed by Stefan Reinauer
parent 28b900afbd
commit b6f765e7c8
3 changed files with 1 additions and 34 deletions

View File

@ -641,7 +641,7 @@ int main(int argc, char** argv) {
while (h->next) {
h = h->next;
char *name_underscore = translate_name(h->name, UNSLASH);
fprintf(autogen, "extern struct chip_operations %s_ops;\n", name_underscore);
fprintf(autogen, "__attribute__((weak)) struct chip_operations %s_ops = {};\n", name_underscore);
free(name_underscore);
}
fprintf(autogen, "#endif\n");