diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-10-05 10:10:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-10-07 10:07:51 +0200 |
commit | a03af1e0b38bca202325f57b19f9a95cbbb7c4c5 (patch) | |
tree | 4bbdfd04371954bb4e93874bad90142c3f347f09 /arch/arm/boards/stm32mp157c-dk2/board.c | |
parent | 2fb1c3da0636addb7b1fb9d016b861ff4fd9da8b (diff) | |
download | barebox-a03af1e0b38bca202325f57b19f9a95cbbb7c4c5.tar.gz barebox-a03af1e0b38bca202325f57b19f9a95cbbb7c4c5.tar.xz |
ARM: stm32mp: migrate board initcalls to board drivers
Board drivers are now the way to go. Migrate the STM32 boards to use it,
to encourage future copy-pasting in following suit.
As the board now supports both DK2 and DK1, rename the prefix to dkx_.
dk1 specifics follow in a separate commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/stm32mp157c-dk2/board.c')
-rw-r--r-- | arch/arm/boards/stm32mp157c-dk2/board.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/arm/boards/stm32mp157c-dk2/board.c b/arch/arm/boards/stm32mp157c-dk2/board.c index 4636603121..a547209cdf 100644 --- a/arch/arm/boards/stm32mp157c-dk2/board.c +++ b/arch/arm/boards/stm32mp157c-dk2/board.c @@ -3,11 +3,8 @@ #include <init.h> #include <mach/bbu.h> -static int dk2_postcore_init(void) +static int dkx_probe(struct device_d *dev) { - if (!of_machine_is_compatible("st,stm32mp157c-dk2")) - return 0; - stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", BBU_HANDLER_FLAG_DEFAULT); @@ -15,4 +12,15 @@ static int dk2_postcore_init(void) return 0; } -postcore_initcall(dk2_postcore_init); + +static const struct of_device_id dkx_of_match[] = { + { .compatible = "st,stm32mp157c-dk2" }, + { /* sentinel */ }, +}; + +static struct driver_d dkx_board_driver = { + .name = "board-stm32mp15xx-dkx", + .probe = dkx_probe, + .of_compatible = dkx_of_match, +}; +postcore_platform_driver(dkx_board_driver); |