dmaengine: sirf: move driver init from module_init to subsys_initcall
PATCH 1/1 dmaengine: sirf: move driver init from module_init to subsys_initcall
From: Barry Song <[email protected]>
if we initilize dma driver by module_init, there are still many devices which will be initilized earlier than dma. these devices will fail to get dma channel.
this moves dmaengine earlier than device_initcall and make dma available for all devices.
--- drivers/dma/sirf-dma.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
drivers/dma/sirf-dma.c +12 -1
@@ -742,7 +742,18 @@ static struct platform_driver sirfsoc_dma_driver = { }, }; -module_platform_driver (sirfsoc_dma_driver); +static __init int sirfsoc_dma_init (void ) +{ +return platform_driver_register (&sirfsoc_dma_driver); +} + +static void __exit sirfsoc_dma_exit(void) +{ +platform_driver_unregister (&sirfsoc_dma_driver); +} + +subsys_initcall (sirfsoc_dma_init); +module_exit (sirfsoc_dma_exit);MODULE_AUTHOR ("Rongjun Ying <[email protected]>, " "Barry Song <[email protected]>" );
Signature · 6 lines
1.7.5.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
PATCH 1/1 dmaengine: sirf: move driver init from module_init to subsys_initcall
Quoted 10 lines · Barry Song
From: Barry Song <[email protected]>
if we initilize dma driver by
module_init, there are still many devices which will be initilized earlier than dma. these devices will fail to get dma channel.
this moves dmaengine earlier thandevice_initcalland make dma available for all devices.Reported-by Renwei Wu <[email protected]>Signed-off-by Barry Song <[email protected]>
Applied thanks, this is what many drivers in susystem do...
--
~Vinod
Quoted 35 lines
--- drivers/dma/sirf-dma.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)drivers/dma/sirf-dma.c +12
-1@@ -742,7 +742,18 @@ static struct platform_driver sirfsoc_dma_driver = { }, }; -module_platform_driver (sirfsoc_dma_driver); +static __init int sirfsoc_dma_init (void ) +{ +return platform_driver_register (&sirfsoc_dma_driver); +} + +static void __exit sirfsoc_dma_exit(void) +{ +platform_driver_unregister (&sirfsoc_dma_driver); +} + +subsys_initcall (sirfsoc_dma_init); +module_exit (sirfsoc_dma_exit);MODULE_AUTHOR ("Rongjun Ying <[email protected]>, " "Barry Song <[email protected]>" );Signature · 6 lines
1.7.5.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog