Commit 53d7e098 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Ulf Hansson

mmc: android-goldfish: use sg_copy_{from,to}_buffer

This handles highmem pages, and also cleans up the code.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 65f9e20e
...@@ -217,8 +217,8 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host, ...@@ -217,8 +217,8 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
* We don't really have DMA, so we need * We don't really have DMA, so we need
* to copy from our platform driver buffer * to copy from our platform driver buffer
*/ */
uint8_t *dest = (uint8_t *)sg_virt(data->sg); sg_copy_to_buffer(data->sg, 1, host->virt_base,
memcpy(dest, host->virt_base, data->sg->length); data->sg->length);
} }
host->data->bytes_xfered += data->sg->length; host->data->bytes_xfered += data->sg->length;
dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len, dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len,
...@@ -393,8 +393,8 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host, ...@@ -393,8 +393,8 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
* We don't really have DMA, so we need to copy to our * We don't really have DMA, so we need to copy to our
* platform driver buffer * platform driver buffer
*/ */
const uint8_t *src = (uint8_t *)sg_virt(data->sg); sg_copy_from_buffer(data->sg, 1, host->virt_base,
memcpy(host->virt_base, src, data->sg->length); data->sg->length);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment