diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-02-12 16:45:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-13 10:19:52 +0100 |
commit | 1db4fae6e97cbd57f10e179daa2f65dd34566113 (patch) | |
tree | 94199fd1902d3fc82dd6a9599635f482968a5bb2 | |
parent | b6701ed76f221922fe54750cea6691cee6de9daa (diff) | |
download | barebox-1db4fae6e97c.tar.gz barebox-1db4fae6e97c.tar.xz |
mci: sdhci: atmel: fix truncation when reading out caps
The capability read out was changed a few years ago to use 32-bit
accessors, but the variable that it was stored in remained at 16-bit
leading to truncation of the upper bits and breaking detection of the
SD-Card on my SAMA5D27-SOM1-EK:
ERROR: barebox-environment chosen:environment-sd.of: probe failed: No such file or directory
Fix this by using the appropriate type. The commit introducing the
regression touched multiple drivers, but the Atmel SDHCI one is the only
one which still used a 16-bit type.
Fixes: 1570f8d8d87e ("mci: sdhci: straighten capabilities register")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240212154551.2259925-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mci/atmel-sdhci-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mci/atmel-sdhci-common.c b/drivers/mci/atmel-sdhci-common.c index 171737ab01..a69d6b67b5 100644 --- a/drivers/mci/atmel-sdhci-common.c +++ b/drivers/mci/atmel-sdhci-common.c @@ -39,7 +39,7 @@ static inline struct at91_sdhci *to_priv(struct sdhci *sdhci) void at91_sdhci_host_capability(struct at91_sdhci *host, unsigned *voltages) { - u16 caps; + u32 caps; caps = sdhci_read32(&host->sdhci, SDHCI_CAPABILITIES); |