- return -ENOMEM instead of -1 - return the result of platform_driver_register Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- commands/mem.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/commands/mem.c b/commands/mem.c index d48f92e..5bef3f7 100644 --- a/commands/mem.c +++ b/commands/mem.c @@ -567,15 +567,10 @@ static struct driver_d mem_drv = { static int mem_init(void) { rw_buf = malloc(RW_BUF_SIZE); - if(!rw_buf) { - printf("%s: Out of memory\n", __FUNCTION__); - return -1; - } + if(!rw_buf) + return -ENOMEM; add_mem_device("mem", 0, ~0, IORESOURCE_MEM_WRITEABLE); - platform_driver_register(&mem_drv); - - return 0; + return platform_driver_register(&mem_drv); } - device_initcall(mem_init); -- 1.8.2.rc2 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox