[PATCH] mci: fix data write
Sascha Hauer
s.hauer at pengutronix.de
Mon Mar 24 04:17:49 PDT 2025
The dest and src fields in struct mci_data are a union, so we cannot not
set them both to different values. Only set one of them to make write
support operational again.
Fixes: 3854311954 ("mmc: merge block read/write functions")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/mci/mci-core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 5b892e8570..947fe44c08 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -360,8 +360,11 @@ static int mci_do_block_op(struct mci *mci, const void *src, void *dst, int bloc
mci->high_capacity != 0 ? blocknum : blocknum * mci->read_bl_len,
MMC_RSP_R1);
- data.src = src;
- data.dest = dst;
+ if (dst)
+ data.dest = dst;
+ else
+ data.src = src;
+
data.blocks = blocks;
data.blocksize = mci->read_bl_len;
data.flags = flags;
--
2.39.5
More information about the barebox
mailing list