summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/hostfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/board/hostfile.c')
-rw-r--r--arch/sandbox/board/hostfile.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index b049baa0a1..f5452afac9 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -102,17 +102,7 @@ device_initcall(hf_init);
int barebox_register_filedev(struct hf_platform_data *hf)
{
- struct device_d *dev;
-
- dev = xzalloc(sizeof(struct device_d));
-
- dev->platform_data = hf;
-
- strcpy(dev->name, "hostfile");
- dev->size = hf->size;
- dev->id = -1;
- dev->map_base = hf->map_base;
-
- return register_device(dev);
+ return !add_generic_device("hostfile", -1, NULL, hf->base, hf->size,
+ IORESOURCE_MEM, hf);
}