staging: board: Remove macro board_staging
authorSong Chen <chensong_2000@189.cn>
Fri, 25 Dec 2020 09:54:45 +0000 (17:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Dec 2020 14:10:30 +0000 (15:10 +0100)
Macro is not supposed to have flow control in it's
statement, remove.

Signed-off-by: Song Chen <chensong_2000@189.cn>
Link: https://lore.kernel.org/r/1608890085-1267-1-git-send-email-chensong_2000@189.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/board/armadillo800eva.c
drivers/staging/board/board.h
drivers/staging/board/kzm9d.c

index 0225234dd7aa6b1ca774d83bce5912fd0aaabe98..a7e8487a2dec4035bdf8a78cefcb7b81a29f1c6e 100644 (file)
@@ -80,9 +80,11 @@ static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
 
 static void __init armadillo800eva_init(void)
 {
-       board_staging_gic_setup_xlate("arm,pl390", 32);
-       board_staging_register_devices(armadillo800eva_devices,
-                                      ARRAY_SIZE(armadillo800eva_devices));
+       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("renesas,armadillo800eva", armadillo800eva_init);
+device_initcall(armadillo800eva_init);
index 5609daf4d8695f0294fc44a3d7da2b614acc34c0..f1c233e4eb1c23a04f3cf50462b393e7c18ff85f 100644 (file)
@@ -32,15 +32,4 @@ 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__ */
index d449a837414e6934ae2d590de936e34773f78159..72b1ad452a30c4d81ba65fc7cfdd3149312f3fe0 100644 (file)
@@ -12,15 +12,17 @@ static struct resource usbs1_res[] __initdata = {
 
 static void __init kzm9d_init(void)
 {
-       board_staging_gic_setup_xlate("arm,pl390", 32);
+       if (of_machine_is_compatible("renesas,kzm9d")) {
+               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));
+               }
        }
 }
 
-board_staging("renesas,kzm9d", kzm9d_init);
+device_initcall(kzm9d_init);