From ff79f39fd5eaf8b2c14157dc703ee7041c49d00e Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 27 Nov 2023 16:59:13 +0100 Subject: [PATCH] drivers/mtd: fix the order in the MTD pointer XFA The commit fixes the order of entries in the MTD pointer XFA `mtd_dev_xfa` according to their index by using the index as the priority in the XFA. --- drivers/include/mtd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/include/mtd.h b/drivers/include/mtd.h index eda7ded808..859edf15c3 100644 --- a/drivers/include/mtd.h +++ b/drivers/include/mtd.h @@ -162,7 +162,8 @@ mtd_dev_t * const mtd_dev_xfa[]; * @param dev MTD device * @param idx Priority of the MTD device pointer within the XFA */ -#define MTD_XFA_ADD(dev, idx) XFA_CONST(mtd_dev_xfa, 0) mtd_dev_t *mtd ## idx = (mtd_dev_t *)&(dev) +#define MTD_XFA_ADD(dev, idx) \ + XFA_CONST(mtd_dev_xfa, idx) mtd_dev_t *mtd ## idx = (mtd_dev_t *)&(dev) /** * @brief Number of MTDs defined in the MTD device array in XFA