diff mbox

arm: prima2: use of_platform_populate instead of of_platform_bus_probe

Message ID 1368523923-27137-1-git-send-email-Baohua.Song@csr.com (mailing list archive)
State New, archived
Headers show

Commit Message

Barry Song May 14, 2013, 9:32 a.m. UTC
use of_platform_populate to populate platform devices, it is suitable
for creating devices which are children of the root node, then makes
things like pcm work.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Rongjun Ying <Rongjun.Ying@csr.com>
---
 arch/arm/mach-prima2/common.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

Comments

Arnd Bergmann May 15, 2013, 2:20 p.m. UTC | #1
On Tuesday 14 May 2013, Barry Song wrote:
> 
> use of_platform_populate to populate platform devices, it is suitable
> for creating devices which are children of the root node, then makes
> things like pcm work.
> 
> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> Signed-off-by: Rongjun Ying <Rongjun.Ying@csr.com>

With 3.10-rc1 and above, you can just remove the sirfsoc_mach_init
function entirely for the same effect.

	Arnd
Barry Song May 15, 2013, 2:42 p.m. UTC | #2
2013/5/15 Arnd Bergmann <arnd@arndb.de>:
> On Tuesday 14 May 2013, Barry Song wrote:
>>
>> use of_platform_populate to populate platform devices, it is suitable
>> for creating devices which are children of the root node, then makes
>> things like pcm work.
>>
>> Signed-off-by: Barry Song <Baohua.Song@csr.com>
>> Signed-off-by: Rongjun Ying <Rongjun.Ying@csr.com>
>
> With 3.10-rc1 and above, you can just remove the sirfsoc_mach_init
> function entirely for the same effect.

ok.  since kernel/setup.c does:

static int __init customize_machine(void)
{
        /*
         * customizes platform devices, or adds new ones
         * On DT based machines, we fall back to populating the
         * machine from the device tree, if no callback is provided,
         * otherwise we would always need an init_machine callback.
         */
        if (machine_desc->init_machine)
                machine_desc->init_machine();
#ifdef CONFIG_OF
        else
                of_platform_populate(NULL, of_default_bus_match_table,
                                        NULL, NULL);
#endif
        return 0;
}

>
>         Arnd

-barry
diff mbox

Patch

diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index 4f94cd8..bb67b90 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -17,14 +17,9 @@ 
 #include <linux/of_platform.h>
 #include "common.h"
 
-static struct of_device_id sirfsoc_of_bus_ids[] __initdata = {
-	{ .compatible = "simple-bus", },
-	{},
-};
-
 void __init sirfsoc_mach_init(void)
 {
-	of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 void __init sirfsoc_init_late(void)