summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorWan Jiabing <wanjiabing@vivo.com>2022-04-27 20:03:09 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2022-05-04 11:56:02 +0200
commit83961aacb2219311e4af5dda34bcc15435becd50 (patch)
tree5e20456162374e1a5a7441021841a6662039e03a /drivers/mmc
parent0e8bb6666e3dcf18e4920a325028647da71eb500 (diff)
downloadlinux-83961aacb2219311e4af5dda34bcc15435becd50.tar.bz2
mmc: atmel-mci: Simplify if(chan) and if(!chan)
Use if(!host->dma.chan) instead of if(chan) and if(!chan) to make code better. Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20220427120310.838843-1-wanjiabing@vivo.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/atmel-mci.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 807177c953f3..91d52ba7a39f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1122,13 +1122,12 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
}
/* If we don't have a channel, we can't do DMA */
- chan = host->dma.chan;
- if (chan)
- host->data_chan = chan;
-
- if (!chan)
+ if (!host->dma.chan)
return -ENODEV;
+ chan = host->dma.chan;
+ host->data_chan = chan;
+
if (data->flags & MMC_DATA_READ) {
host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM;
maxburst = atmci_convert_chksize(host,