From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] mci: fix data write
Date: Mon, 24 Mar 2025 12:17:49 +0100 [thread overview]
Message-ID: <20250324111749.2739671-1-s.hauer@pengutronix.de> (raw)
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@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
next reply other threads:[~2025-03-24 11:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 11:17 Sascha Hauer [this message]
2025-03-25 7:16 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324111749.2739671-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox