[PATCH 2/5] resource: statically initialize iomem resource

Sascha Hauer s.hauer at pengutronix.de
Sun Oct 7 07:39:48 EDT 2012


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 at pengutronix.de>
---
 common/resource.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/common/resource.c b/common/resource.c
index da631d3..ea6abe8 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);
-- 
1.7.10.4




More information about the barebox mailing list