summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-08-26 08:30:21 -0600
committerTom Rini <trini@konsulko.com>2025-08-26 08:30:21 -0600
commit349cf24859b5e169a441d975fb4484d8597964bc (patch)
tree1ad2aa4c3b839b006e40ece58d02848bdaa02b4f /drivers/mmc
parentdca578a9c9decb85271665de8086b8f41731d388 (diff)
parentc1168f99387b40f5e3323ff16c670427c2c8a66e (diff)
Merge tag 'u-boot-at91-fixes-2025.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91
First set of u-boot-at91 fixes for the 2025.10 cycle: This set includes smatch fixes for clocks and mmc and one QSPI fix.
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/gen_atmel_mci.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
index 6a531fa0961..838b4f4a65a 100644
--- a/drivers/mmc/gen_atmel_mci.c
+++ b/drivers/mmc/gen_atmel_mci.c
@@ -206,10 +206,9 @@ static u32 mci_data_read(atmel_mci_t *mci, u32* data, u32 error_flags)
goto io_fail;
} while (!(status & MMCI_BIT(RXRDY)));
- if (status & MMCI_BIT(RXRDY)) {
- *data = readl(&mci->rdr);
- status = 0;
- }
+ *data = readl(&mci->rdr);
+ status = 0;
+
io_fail:
return status;
}
@@ -225,10 +224,9 @@ static u32 mci_data_write(atmel_mci_t *mci, u32* data, u32 error_flags)
goto io_fail;
} while (!(status & MMCI_BIT(TXRDY)));
- if (status & MMCI_BIT(TXRDY)) {
- writel(*data, &mci->tdr);
- status = 0;
- }
+ writel(*data, &mci->tdr);
+ status = 0;
+
io_fail:
return status;
}
@@ -265,13 +263,15 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
/* Figure out the transfer arguments */
cmdr = mci_encode_cmd(cmd, data, &error_flags);
- mci_set_blklen(mci, data->blocksize);
+ if (data) {
+ mci_set_blklen(mci, data->blocksize);
- /* For multi blocks read/write, set the block register */
- if ((cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK)
- || (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK))
- writel(data->blocks | MMCI_BF(BLKLEN, data->blocksize),
- &mci->blkr);
+ /* For multi blocks read/write, set the block register */
+ if (cmd->cmdidx == MMC_CMD_READ_MULTIPLE_BLOCK ||
+ cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK)
+ writel(data->blocks | MMCI_BF(BLKLEN, data->blocksize),
+ &mci->blkr);
+ }
/* Send the command */
writel(cmd->cmdarg, &mci->argr);