Skip to content

Commit 23e0bf5

Browse files
pussuwxiaoxiang781216
authored andcommitted
imx9_usdhc.c: Fix build error when CONFIG_ARM64_DCACHE_DISABLE=y
priv->rxbuffer does not exist when CONFIG_ARM64_DCACHE_DISABLE=y so references to it will create a build error -> flag / remove accesses to it.
1 parent 52baca0 commit 23e0bf5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arch/arm64/src/imx9/imx9_usdhc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,7 @@ static int imx9_dmapreflight(struct sdio_dev_s *dev,
29852985
/* DMA must be possible to the buffer and it must be word (4 bytes) aligned
29862986
*/
29872987

2988-
if (buffer != priv->rxbuffer && ((uintptr_t)buffer & 3) != 0)
2988+
if (((uintptr_t)buffer & 3) != 0)
29892989
{
29902990
mcerr("non word aligned buffer:%p\n", buffer);
29912991
return -EFAULT;
@@ -3039,11 +3039,12 @@ static int imx9_dmarecvsetup(struct sdio_dev_s *dev,
30393039
struct imx9_dev_s *priv = (struct imx9_dev_s *)dev;
30403040
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
30413041

3042-
#if defined(CONFIG_ARCH_HAVE_SDIO_PREFLIGHT)
3043-
/* Normaly imx9_dmapreflight is called prior to imx9_dmarecvsetup
3044-
* except for the case where the CSR read is done at initalization
3042+
#if defined(CONFIG_ARCH_HAVE_SDIO_PREFLIGHT) && \
3043+
!defined(CONFIG_ARM64_DCACHE_DISABLE)
3044+
/* Normally imx9_dmapreflight is called prior to imx9_dmarecvsetup
3045+
* except for the case where the CSR read is done at initialization.
30453046
*
3046-
* With a total read size of less then priv->rxbuffer we can
3047+
* With a total read size of less then priv->rxbuffer we can
30473048
* handle the unaligned case herein, using the rxbuffer.
30483049
*
30493050
* Any other case is a fault.

0 commit comments

Comments
 (0)