[PATCH] rpmsg bus subsys_initcall initialization ordering

From: Federico Fuga
Date: Tue Jul 10 2012 - 12:07:41 EST


omaprpc depends on the rpmsg bus.
When those two modules are compiled statically, the omaprpc is initialized before the rpmsg bus, triggering a BUG() in driver_register.
This of course can be prevented if they are compiled as modules and loaded in the right order.
This patch solves this problem by forcing the rpmsg module to be initialized at subsystem level.

Signed-off-by: Federico Fuga <fuga@xxxxxxxxxxxxxx>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 210c4eb..589819f 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1078,7 +1078,7 @@ static int __init rpmsg_init(void)

return ret;
}
-module_init(rpmsg_init);
+subsys_initcall(rpmsg_init);

static void __exit rpmsg_fini(void)
{
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/