From: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Benjamin Herrenschmidt
<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Scott Wood <oss-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org>
Subject: [PATCH 5/5] powerpc/83xx: enable the default of probe
Date: Tue, 23 Aug 2016 10:06:59 +0800 [thread overview]
Message-ID: <1471918019-19472-6-git-send-email-haokexin@gmail.com> (raw)
In-Reply-To: <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Use the default of probe function of_platform_default_populate_init()
to kill the arch specific duplicated codes.
Signed-off-by: Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/powerpc/platforms/83xx/asp834x.c | 2 --
arch/powerpc/platforms/83xx/km83xx.c | 2 --
arch/powerpc/platforms/83xx/misc.c | 25 ++++++++-----------------
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc832x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc834x_itx.c | 12 ------------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc836x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 2 --
arch/powerpc/platforms/83xx/mpc837x_mds.c | 2 --
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 --
arch/powerpc/platforms/83xx/mpc83xx.h | 1 -
arch/powerpc/platforms/83xx/sbc834x.c | 2 --
15 files changed, 8 insertions(+), 54 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 575afd6eb36a..2219a1f8c535 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -34,8 +34,6 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
}
-machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index d8642a4afc74..e2276f12eafe 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -154,8 +154,6 @@ static void __init mpc83xx_km_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
-
/* list of the supported boards */
static char *board[] __initdata = {
"Keymile,KMETER1",
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index d75c9816a5c9..4a88edd51d1a 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -114,23 +114,6 @@ void __init mpc83xx_ipic_and_qe_init_IRQ(void)
}
#endif /* CONFIG_QUICC_ENGINE */
-static const struct of_device_id of_bus_ids[] __initconst = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus" },
- { .compatible = "gianfar" },
- { .compatible = "gpio-leds", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-int __init mpc83xx_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
- return 0;
-}
-
#ifdef CONFIG_PCI
void __init mpc83xx_setup_pci(void)
{
@@ -149,4 +132,12 @@ void __init mpc83xx_setup_arch(void)
ppc_md.progress("mpc83xx_setup_arch()", 0);
mpc83xx_setup_pci();
+ arch_enable_default_of_probe();
}
+
+BUS_OF_DECLARE_TYPE(type_soc, "soc");
+BUS_OF_DECLARE_TYPE(type_qe, "qe");
+BUS_OF_DECLARE_COMPAT(simple_bus, "simple-bus");
+BUS_OF_DECLARE_COMPAT(gianfar, "gianfar");
+BUS_OF_DECLARE_COMPAT(gpio_leds, "gpio-leds");
+BUS_OF_DECLARE_COMPAT(qe, "fsl,qe");
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index 272c41c387b9..0d073102cfbb 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -46,8 +46,6 @@ static int __init mpc830x_rdb_probe(void)
return of_device_compatible_match(of_root, board);
}
-machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
-
define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index fd80fd570e67..16926fb95592 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -46,8 +46,6 @@ static int __init mpc831x_rdb_probe(void)
return of_device_compatible_match(of_root, board);
}
-machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
-
define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index bb7b25acf26f..01c0602347a7 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -92,8 +92,6 @@ static void __init mpc832x_sys_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 09d1bbf25b5d..4626d909e7fa 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -210,8 +210,6 @@ static void __init mpc832x_rdb_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 73a5267df497..60717eb6b029 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -38,18 +38,6 @@
#include "mpc83xx.h"
-static const struct of_device_id mpc834x_itx_ids[] __initconst = {
- { .compatible = "fsl,pq2pro-localbus", },
- {},
-};
-
-static int __init mpc834x_itx_declare_of_platform_devices(void)
-{
- mpc83xx_declare_of_platform_devices();
- return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
-}
-machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 009cfc18a4ee..64ba2f8eab9f 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -81,8 +81,6 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 4fc3051c2b2e..0cc26696ca06 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -135,8 +135,6 @@ static void __init mpc836x_mds_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-machine_device_initcall(mpc836x_mds, mpc83xx_declare_of_platform_devices);
-
#ifdef CONFIG_QE_USB
static int __init mpc836x_usb_cfg(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index 93f024fd9b45..ac36ea02c0a2 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -27,8 +27,6 @@
#include "mpc83xx.h"
-machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
-
static void __init mpc836x_rdk_setup_arch(void)
{
mpc83xx_setup_arch();
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 3b34cc1f626c..2e4f29190844 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -83,8 +83,6 @@ static void __init mpc837x_mds_setup_arch(void)
mpc837xmds_usb_cfg();
}
-machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 0c55fa6af2d5..9d0c9c6af736 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -55,8 +55,6 @@ static void __init mpc837x_rdb_setup_arch(void)
mpc837x_rdb_sd_cfg();
}
-machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
-
static const char * const board[] __initconst = {
"fsl,mpc8377rdb",
"fsl,mpc8378rdb",
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 636eb9d0401a..77f9658aa22e 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -85,7 +85,6 @@ extern void mpc83xx_setup_pci(void);
#define mpc83xx_setup_pci() do {} while (0)
#endif
-extern int mpc83xx_declare_of_platform_devices(void);
extern void mpc83xx_setup_arch(void);
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index cb4bdabfdf1c..e750a0ed644a 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -50,8 +50,6 @@ static void __init sbc834x_setup_arch(void)
mpc83xx_setup_arch();
}
-machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-08-23 2:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 2:06 [PATCH 0/5] ppc32: use the default of_platform_default_populate_init() for 83xx boards Kevin Hao
[not found] ` <1471918019-19472-1-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-23 2:06 ` [PATCH 1/5] of/platform: introduce arch_want_default_of_probe() Kevin Hao
2016-08-23 2:06 ` [PATCH 2/5] powerpc: introduce arch_enable_default_of_probe() Kevin Hao
2016-08-23 2:06 ` [PATCH 3/5] of/platform: introduce a generic way to declare a platform bus Kevin Hao
[not found] ` <1471918019-19472-4-git-send-email-haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-25 13:44 ` Rob Herring
2016-08-27 7:40 ` Kevin Hao
2016-08-29 21:08 ` Rob Herring
2016-08-23 2:06 ` [PATCH 4/5] powerpc/83xx: factor out the common codes of setup arch functions Kevin Hao
2016-08-23 2:06 ` Kevin Hao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471918019-19472-6-git-send-email-haokexin@gmail.com \
--to=haokexin-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org \
--cc=oss-fOR+EgIDQEHk1uMJSBkQmQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).