summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-10-06 19:49:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-10-07 12:58:10 +0200
commit0b494649fa46d00db9ffef75431f4ea3ed433bdb (patch)
tree8d5bd64d3748d0eb0d96d47ef2897d2733e60e0b /common
parent54763e2c170bfb8dcd09f168f7c2cd866d380399 (diff)
downloadbarebox-0b494649fa46d00db9ffef75431f4ea3ed433bdb.tar.gz
barebox-0b494649fa46d00db9ffef75431f4ea3ed433bdb.tar.xz
resource: statically initialize iomem resource
This gets us rid of an initcall and also has the advantage that request_iomem_region can be called at any time now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/resource.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/common/resource.c b/common/resource.c
index da631d3997..ea6abe88e3 100644
--- a/common/resource.c
+++ b/common/resource.c
@@ -101,6 +101,8 @@ int release_region(struct resource *res)
struct resource iomem_resource = {
.start = 0,
.end = 0xffffffff,
+ .name = "iomem",
+ .children = LIST_HEAD_INIT(iomem_resource.children),
};
/*
@@ -111,11 +113,3 @@ struct resource *request_iomem_region(const char *name,
{
return request_region(&iomem_resource, name, start, end);
}
-
-static int iomem_init(void)
-{
- init_resource(&iomem_resource, "iomem");
-
- return 0;
-}
-postcore_initcall(iomem_init);