From 7557147927fcc4099d62f564f42babc2370834f3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 24 Sep 2016 18:20:07 -0600 Subject: spl: Convert spl_sata_load_image() to use linker list Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- common/spl/spl.c | 4 ---- common/spl/spl_sata.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'common/spl') diff --git a/common/spl/spl.c b/common/spl/spl.c index d2e23bf2d8..9890a889ab 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -401,10 +401,6 @@ static int spl_load_image(u32 boot_device) return spl_net_load_image(&bootdev); #endif #endif -#ifdef CONFIG_SPL_SATA_SUPPORT - case BOOT_DEVICE_SATA: - return spl_sata_load_image(&bootdev); -#endif #ifdef CONFIG_SPL_BOARD_LOAD_IMAGE case BOOT_DEVICE_BOARD: return spl_board_load_image(&bootdev); diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index 77fd73c989..1a21c051a1 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR; -int spl_sata_load_image(struct spl_boot_device *bootdev) +static int spl_sata_load_image(struct spl_boot_device *bootdev) { int err; struct blk_desc *stor_dev; @@ -53,3 +53,4 @@ int spl_sata_load_image(struct spl_boot_device *bootdev) return 0; } +SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_SATA, spl_sata_load_image); -- cgit