Skip to content

Commit

Permalink
Revert "staging: board: Remove macro board_staging"
Browse files Browse the repository at this point in the history
This reverts commit 850c35b as it
breaks the build.

Cc: Song Chen <[email protected]>
Reported-by: Stephen Rothwell <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jan 4, 2021
1 parent 1e9a9c7 commit 1f82c33
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
10 changes: 4 additions & 6 deletions drivers/staging/board/armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
11 changes: 11 additions & 0 deletions drivers/staging/board/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */
18 changes: 8 additions & 10 deletions drivers/staging/board/kzm9d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 1f82c33

Please sign in to comment.