提交 8292adc6 编写于 作者: F Fabian Frederick 提交者: Ulf Hansson

mmc: omap: use for_each_sg() for scatterlist parsing

See Documentation/DMA-API.txt - Part Id
Signed-off-by: NFabian Frederick <fabf@skynet.be>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 2d532d45
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册