summaryrefslogtreecommitdiff
path: root/drivers/staging/board
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-04 15:55:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-04 15:55:40 +0100
commit1f82c33205db389007d2dd44ffdc124a24b9108f (patch)
tree515de28365830d289b46a0cb78616340ab1a33e9 /drivers/staging/board
parent1e9a9c7cba3ca5cbd3201a9f3b8dc6e8d7bef1c0 (diff)
Revert "staging: board: Remove macro board_staging"
This reverts commit 850c35bb28ecd80bdbecc5cc4d47d0c6941d6d83 as it breaks the build. Cc: Song Chen <chensong_2000@189.cn> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20210104122653.6f35b9bb@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/board')
-rw-r--r--drivers/staging/board/armadillo800eva.c10
-rw-r--r--drivers/staging/board/board.h11
-rw-r--r--drivers/staging/board/kzm9d.c18
3 files changed, 23 insertions, 16 deletions
diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
index a7e8487a2dec..0225234dd7aa 100644
--- a/drivers/staging/board/armadillo800eva.c
+++ b/drivers/staging/board/armadillo800eva.c
@@ -80,11 +80,9 @@ static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
static void __init armadillo800eva_init(void)
{
- if (of_machine_is_compatible("renesas,armadillo800eva")) {
- board_staging_gic_setup_xlate("arm,pl390", 32);
- board_staging_register_devices(armadillo800eva_devices,
- ARRAY_SIZE(armadillo800eva_devices));
- }
+ board_staging_gic_setup_xlate("arm,pl390", 32);
+ board_staging_register_devices(armadillo800eva_devices,
+ ARRAY_SIZE(armadillo800eva_devices));
}
-device_initcall(armadillo800eva_init);
+board_staging("renesas,armadillo800eva", armadillo800eva_init);
diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h
index f1c233e4eb1c..5609daf4d869 100644
--- a/drivers/staging/board/board.h
+++ b/drivers/staging/board/board.h
@@ -32,4 +32,15 @@ int board_staging_register_device(const struct board_staging_dev *dev);
void board_staging_register_devices(const struct board_staging_dev *devs,
unsigned int ndevs);
+#define board_staging(str, fn) \
+static int __init runtime_board_check(void) \
+{ \
+ if (of_machine_is_compatible(str)) \
+ fn(); \
+ \
+ return 0; \
+} \
+ \
+device_initcall(runtime_board_check)
+
#endif /* __BOARD_H__ */
diff --git a/drivers/staging/board/kzm9d.c b/drivers/staging/board/kzm9d.c
index 72b1ad452a30..d449a837414e 100644
--- a/drivers/staging/board/kzm9d.c
+++ b/drivers/staging/board/kzm9d.c
@@ -12,17 +12,15 @@ static struct resource usbs1_res[] __initdata = {
static void __init kzm9d_init(void)
{
- if (of_machine_is_compatible("renesas,kzm9d")) {
- board_staging_gic_setup_xlate("arm,pl390", 32);
+ board_staging_gic_setup_xlate("arm,pl390", 32);
- if (!board_staging_dt_node_available(usbs1_res,
- ARRAY_SIZE(usbs1_res))) {
- board_staging_gic_fixup_resources(usbs1_res,
- ARRAY_SIZE(usbs1_res));
- platform_device_register_simple("emxx_udc", -1, usbs1_res,
- ARRAY_SIZE(usbs1_res));
- }
+ if (!board_staging_dt_node_available(usbs1_res,
+ ARRAY_SIZE(usbs1_res))) {
+ board_staging_gic_fixup_resources(usbs1_res,
+ ARRAY_SIZE(usbs1_res));
+ platform_device_register_simple("emxx_udc", -1, usbs1_res,
+ ARRAY_SIZE(usbs1_res));
}
}
-device_initcall(kzm9d_init);
+board_staging("renesas,kzm9d", kzm9d_init);