[PATCH] mci: sdhci: initialize dma state on non-data commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commands without data will leave the dma parameter uninitialized
in sdhci_setup_data_dma(). Drivers then decide whether to set
SDHCI_DMA_EN based on this uninitialized data. This seems to be
mostly harmless as the host controllers seem to ignore this bit
on non-data commands, but it's still a bit confusing. Make sure
to always return a valid state.

Signed-off-by: Lucas Stach <dev@xxxxxxxxxx>
---
 drivers/mci/sdhci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index f1bb7f45d810..2c12f00ab967 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -478,8 +478,11 @@ void sdhci_setup_data_dma(struct sdhci *sdhci, struct mci_data *data,
 	struct device *dev = sdhci_dev(sdhci);
 	int nbytes;
 
-	if (!data)
+	if (!data) {
+		if (dma)
+			*dma = SDHCI_NO_DMA;
 		return;
+	}
 
 	sdhci_setup_data_pio(sdhci, data);
 
-- 
2.47.1





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux