Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+23 -16
+4 -6
drivers/staging/board/armadillo800eva.c
··· 80 80 81 81 static void __init armadillo800eva_init(void) 82 82 { 83 - if (of_machine_is_compatible("renesas,armadillo800eva")) { 84 - board_staging_gic_setup_xlate("arm,pl390", 32); 85 - board_staging_register_devices(armadillo800eva_devices, 86 - ARRAY_SIZE(armadillo800eva_devices)); 87 - } 83 + board_staging_gic_setup_xlate("arm,pl390", 32); 84 + board_staging_register_devices(armadillo800eva_devices, 85 + ARRAY_SIZE(armadillo800eva_devices)); 88 86 } 89 87 90 - device_initcall(armadillo800eva_init); 88 + board_staging("renesas,armadillo800eva", armadillo800eva_init);
+11
drivers/staging/board/board.h
··· 32 32 void board_staging_register_devices(const struct board_staging_dev *devs, 33 33 unsigned int ndevs); 34 34 35 + #define board_staging(str, fn) \ 36 + static int __init runtime_board_check(void) \ 37 + { \ 38 + if (of_machine_is_compatible(str)) \ 39 + fn(); \ 40 + \ 41 + return 0; \ 42 + } \ 43 + \ 44 + device_initcall(runtime_board_check) 45 + 35 46 #endif /* __BOARD_H__ */
+8 -10
drivers/staging/board/kzm9d.c
··· 12 12 13 13 static void __init kzm9d_init(void) 14 14 { 15 - if (of_machine_is_compatible("renesas,kzm9d")) { 16 - board_staging_gic_setup_xlate("arm,pl390", 32); 15 + board_staging_gic_setup_xlate("arm,pl390", 32); 17 16 18 - if (!board_staging_dt_node_available(usbs1_res, 19 - ARRAY_SIZE(usbs1_res))) { 20 - board_staging_gic_fixup_resources(usbs1_res, 21 - ARRAY_SIZE(usbs1_res)); 22 - platform_device_register_simple("emxx_udc", -1, usbs1_res, 23 - ARRAY_SIZE(usbs1_res)); 24 - } 17 + if (!board_staging_dt_node_available(usbs1_res, 18 + ARRAY_SIZE(usbs1_res))) { 19 + board_staging_gic_fixup_resources(usbs1_res, 20 + ARRAY_SIZE(usbs1_res)); 21 + platform_device_register_simple("emxx_udc", -1, usbs1_res, 22 + ARRAY_SIZE(usbs1_res)); 25 23 } 26 24 } 27 25 28 - device_initcall(kzm9d_init); 26 + board_staging("renesas,kzm9d", kzm9d_init);