From: Fabian Frederick Date: Tue, 16 Jun 2015 19:15:15 +0000 (+0200) Subject: mmc: omap: use for_each_sg() for scatterlist parsing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8292adc6ba1d59fa227bcc43cec2ce207cbb588c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mmc: omap: use for_each_sg() for scatterlist parsing See Documentation/DMA-API.txt - Part Id Signed-off-by: Fabian Frederick Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 68dd6c79c378..70dcf074fbe3 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -948,6 +948,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) { struct mmc_data *data = req->data; int i, use_dma = 1, block_size; + struct scatterlist *sg; unsigned sg_len; host->data = data; @@ -972,8 +973,8 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) sg_len = (data->blocks == 1) ? 1 : data->sg_len; /* Only do DMA for entire blocks */ - for (i = 0; i < sg_len; i++) { - if ((data->sg[i].length % block_size) != 0) { + for_each_sg(data->sg, sg, sg_len, i) { + if ((sg->length % block_size) != 0) { use_dma = 0; break; }