]> git.karo-electronics.de Git - karo-tx-linux.git/commit
of/platform: Add common method to populate default bus
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 1 Jun 2016 06:52:54 +0000 (14:52 +0800)
committerRob Herring <robh@kernel.org>
Thu, 23 Jun 2016 19:58:30 +0000 (14:58 -0500)
commit44a7185c2ae6383c88ff5b1ef2e2969f35d7b8b7
tree7edab7e6a92c796868c28d2e1b489318ef68f4a4
parentbb8e15d60462a84a25a3bf33e8bc29b46c6d470a
of/platform: Add common method to populate default bus

The arch code calls of_platform_populate() with default match table
when it wants to populate default bus.

This patch introduce a new of_platform_default_populate_init() and make it
arch_initcall_sync(it should be later than some iommu configration, eg,
of_iommu_init() and swiotlb_late_init in arm64), then we can finish above
job in common method.

In order to avoid the default bus being populated twice, simply checking
the flag of bus node whether has be set OF_POPULATED_BUS or not.

After that, we can safely remove the caller in arch code.

Btw, add debug print in of_platform_populate(), and use __func__ to
print function's name of of_platform_bus_create().

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/platform.c