[PATCH] mci: stm32_sdmmc2: fix benign typo in dma_map_single

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Apr 10 06:03:02 PDT 2025


struct mci_data::src and ::dest are members of the same union and thus
can be used interchangeably, provided that the difference in type is
accounted for.

Nevertheless, it makes code easier to reason about and saves needless
casts to use the correct union member. Do that for the read case.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/mci/stm32_sdmmc2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index 64a7171d2cae..30745ea7c6c0 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -271,7 +271,7 @@ static dma_addr_t stm32_sdmmc2_start_data(struct stm32_sdmmc2_priv *priv,
 
 	if (data->flags & MMC_DATA_READ) {
 		data_ctrl |= SDMMC_DCTRL_DTDIR;
-		idmabase0 = dma_map_single(priv->dev, (void *)data->src, num_bytes,
+		idmabase0 = dma_map_single(priv->dev, data->dest, num_bytes,
 					   DMA_FROM_DEVICE);
 	} else {
 		idmabase0 = dma_map_single(priv->dev, (void *)data->src, num_bytes,
-- 
2.39.5




More information about the barebox mailing list