spl: Correct priority selection for image loaders
authorSimon Glass <sjg@chromium.org>
Mon, 21 Oct 2019 03:31:45 +0000 (21:31 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Sat, 2 Nov 2019 23:20:26 +0000 (07:20 +0800)
At present the name of the image comes first in the linker-list symbol
used. This means that the name of the function sets the sort order, which
is not the intention.

Update it to put the boot-device type first, then the priority. This
produces the expected behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
include/spl.h

index b5387ef273df31db0601aed37092f34087f54baa..08ffddac29f27a5495881dbfc58258e220df3ed7 100644 (file)
@@ -332,14 +332,14 @@ struct spl_image_loader {
  */
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 #define SPL_LOAD_IMAGE_METHOD(_name, _priority, _boot_device, _method) \
-       SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \
+       SPL_LOAD_IMAGE(_boot_device ## _priority ## _method) = { \
                .name = _name, \
                .boot_device = _boot_device, \
                .load_image = _method, \
        }
 #else
 #define SPL_LOAD_IMAGE_METHOD(_name, _priority, _boot_device, _method) \
-       SPL_LOAD_IMAGE(_method ## _priority ## _boot_device) = { \
+       SPL_LOAD_IMAGE(_boot_device ## _priority ## _method) = { \
                .boot_device = _boot_device, \
                .load_image = _method, \
        }