non-root devices are not supposed to be accessed outside of static.c except by
authorStefan Reinauer <stepan@coresystems.de>
Mon, 9 Aug 2010 12:02:00 +0000 (12:02 +0000)
committerStefan Reinauer <stepan@openbios.org>
Mon, 9 Aug 2010 12:02:00 +0000 (12:02 +0000)
walking the tree.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5686 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/sconfig/main.c

index 062eedd2e02a7b8e53d84d8b4b738e60d4960a74..be423813407ae409f8366359ce36af474899f0ef 100755 (executable)
@@ -283,18 +283,20 @@ static void pass0(FILE *fil, struct device *ptr) {
        if (ptr->type == device && ptr->id == 0)
                fprintf(fil, "struct bus %s_links[];\n", ptr->name);
        if ((ptr->type == device) && (ptr->id != 0) && (!ptr->used)) {
-               fprintf(fil, "struct device %s;\n", ptr->name);
+               fprintf(fil, "static struct device %s;\n", ptr->name);
                if (ptr->rescnt > 0)
                        fprintf(fil, "struct resource %s_res[];\n", ptr->name);
                if (ptr->children || ptr->multidev)
                        fprintf(fil, "struct bus %s_links[];\n", ptr->name);
        }
        if ((ptr->type == device) && (ptr->id != 0) && ptr->used)
-               fprintf(fil, "struct device %s;\n", ptr->aliased_name);
+               fprintf(fil, "static struct device %s;\n", ptr->aliased_name);
 }
 
 static void pass1(FILE *fil, struct device *ptr) {
        if (!ptr->used && (ptr->type == device)) {
+               if (ptr->id != 0)
+                       fprintf(fil, "static ", ptr->name);
                fprintf(fil, "struct device %s = {\n", ptr->name);
                fprintf(fil, "\t.ops = %s,\n", (ptr->ops)?(ptr->ops):"0");
                fprintf(fil, "\t.bus = &%s_links[%d],\n", ptr->bus->name, ptr->bus->link);