summaryrefslogtreecommitdiff
path: root/util/sconfig
diff options
context:
space:
mode:
Diffstat (limited to 'util/sconfig')
-rw-r--r--util/sconfig/main.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 548063fd88..265e7285cb 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -696,17 +696,17 @@ static int dev_has_children(struct device *dev)
static void pass0(FILE *fil, struct device *ptr, struct device *next)
{
if (ptr == &base_root_dev) {
- fprintf(fil, "DEVTREE_CONST struct bus %s_links[];\n",
+ fprintf(fil, "STORAGE struct bus %s_links[];\n",
ptr->name);
return;
}
- fprintf(fil, "static DEVTREE_CONST struct device %s;\n", ptr->name);
+ fprintf(fil, "STORAGE struct device %s;\n", ptr->name);
if (ptr->res)
- fprintf(fil, "DEVTREE_CONST struct resource %s_res[];\n",
+ fprintf(fil, "STORAGE struct resource %s_res[];\n",
ptr->name);
if (dev_has_children(ptr))
- fprintf(fil, "DEVTREE_CONST struct bus %s_links[];\n",
+ fprintf(fil, "STORAGE struct bus %s_links[];\n",
ptr->name);
if (next)
@@ -723,7 +723,7 @@ static void emit_resources(FILE *fil, struct device *ptr)
return;
int i = 1;
- fprintf(fil, "DEVTREE_CONST struct resource %s_res[] = {\n", ptr->name);
+ fprintf(fil, "STORAGE struct resource %s_res[] = {\n", ptr->name);
struct resource *r = ptr->res;
while (r) {
fprintf(fil,
@@ -765,7 +765,7 @@ static void emit_bus(FILE *fil, struct bus *bus)
static void emit_dev_links(FILE *fil, struct device *ptr)
{
- fprintf(fil, "DEVTREE_CONST struct bus %s_links[] = {\n",
+ fprintf(fil, "STORAGE struct bus %s_links[] = {\n",
ptr->name);
struct bus *bus = ptr->bus;
@@ -784,9 +784,11 @@ static void pass1(FILE *fil, struct device *ptr, struct device *next)
struct chip_instance *chip_ins = ptr->chip_instance;
int has_children = dev_has_children(ptr);
- if (ptr != &base_root_dev)
- fprintf(fil, "static ");
- fprintf(fil, "DEVTREE_CONST struct device %s = {\n", ptr->name);
+ if (ptr == &base_root_dev)
+ fprintf(fil, "DEVTREE_CONST struct device %s = {\n", ptr->name);
+ else
+ fprintf(fil, "STORAGE struct device %s = {\n", ptr->name);
+
fprintf(fil, "#if !DEVTREE_EARLY\n");
/*
@@ -942,7 +944,7 @@ static void emit_chip_headers(FILE *fil, struct chip *chip)
static void emit_chip_instance(FILE *fil, struct chip_instance *instance)
{
- fprintf(fil, "DEVTREE_CONST struct %s_config %s_info_%d = {",
+ fprintf(fil, "STORAGE struct %s_config %s_info_%d = {",
instance->chip->name_underscore,
instance->chip->name_underscore,
instance->id);
@@ -965,6 +967,8 @@ static void emit_chips(FILE *fil)
emit_chip_headers(fil, chip);
+ fprintf(fil, "\n#define STORAGE static __unused DEVTREE_CONST\n\n");
+
for (; chip; chip = chip->next) {
if (!chip->chiph_exists)
continue;