This patch fixes the checkpatch.pl warning: WARNING: Macros with flow control statements should be avoided +#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) + Signed-off-by: Nikita Eshkeev <kastolom@xxxxxxxxx> --- drivers/staging/board/armadillo800eva.c | 13 +++++++++++-- drivers/staging/board/board.h | 11 ----------- drivers/staging/board/kzm9d.c | 13 +++++++++++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c index 4de4fd0..f759d8f 100644 --- a/drivers/staging/board/armadillo800eva.c +++ b/drivers/staging/board/armadillo800eva.c @@ -94,11 +94,20 @@ static const struct board_staging_dev armadillo800eva_devices[] __initconst = { }, }; -static void __init armadillo800eva_init(void) +static void armadillo800eva_setup(void) { board_staging_gic_setup_xlate("arm,pl390", 32); board_staging_register_devices(armadillo800eva_devices, ARRAY_SIZE(armadillo800eva_devices)); } -board_staging("renesas,armadillo800eva", armadillo800eva_init); +static int __init armadillo800eva_init(void) +{ + const char *compat = "renesas,armadillo800eva"; + + if (of_machine_is_compatible(compat)) + armadillo800eva_setup(); + return 0; +} + +device_initcall(armadillo800eva_init); diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h index 42ed125..0fa1197 100644 --- a/drivers/staging/board/board.h +++ b/drivers/staging/board/board.h @@ -31,15 +31,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__ */ diff --git a/drivers/staging/board/kzm9d.c b/drivers/staging/board/kzm9d.c index 05a6d43..2884823 100644 --- a/drivers/staging/board/kzm9d.c +++ b/drivers/staging/board/kzm9d.c @@ -9,7 +9,7 @@ static struct resource usbs1_res[] __initdata = { DEFINE_RES_IRQ(159), }; -static void __init kzm9d_init(void) +static void kzm9d_setup(void) { board_staging_gic_setup_xlate("arm,pl390", 32); @@ -22,4 +22,13 @@ static void __init kzm9d_init(void) } } -board_staging("renesas,kzm9d", kzm9d_init); +static int __init kzm9d_init(void) +{ + const char *compat = "renesas,kzm9d"; + + if (of_machine_is_compatible(compat)) + kzm9d_setup(); + return 0; +} + +device_initcall(kzm9d_init); -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel