Skip to content

Commit 83961aa

Browse files
Wan JiabingUlf Hansson
authored andcommitted
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>
1 parent 0e8bb66 commit 83961aa

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/mmc/host/atmel-mci.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,12 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
11221122
}
11231123

11241124
/* If we don't have a channel, we can't do DMA */
1125-
chan = host->dma.chan;
1126-
if (chan)
1127-
host->data_chan = chan;
1128-
1129-
if (!chan)
1125+
if (!host->dma.chan)
11301126
return -ENODEV;
11311127

1128+
chan = host->dma.chan;
1129+
host->data_chan = chan;
1130+
11321131
if (data->flags & MMC_DATA_READ) {
11331132
host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM;
11341133
maxburst = atmci_convert_chksize(host,

0 commit comments

Comments
 (0)