Skip to content

Commit 53d7e09

Browse files
Christoph Hellwigstorulf
authored andcommitted
mmc: android-goldfish: use sg_copy_{from,to}_buffer
This handles highmem pages, and also cleans up the code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 65f9e20 commit 53d7e09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mmc/host/android-goldfish.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
217217
* We don't really have DMA, so we need
218218
* to copy from our platform driver buffer
219219
*/
220-
uint8_t *dest = (uint8_t *)sg_virt(data->sg);
221-
memcpy(dest, host->virt_base, data->sg->length);
220+
sg_copy_to_buffer(data->sg, 1, host->virt_base,
221+
data->sg->length);
222222
}
223223
host->data->bytes_xfered += data->sg->length;
224224
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,
393393
* We don't really have DMA, so we need to copy to our
394394
* platform driver buffer
395395
*/
396-
const uint8_t *src = (uint8_t *)sg_virt(data->sg);
397-
memcpy(host->virt_base, src, data->sg->length);
396+
sg_copy_from_buffer(data->sg, 1, host->virt_base,
397+
data->sg->length);
398398
}
399399
}
400400

0 commit comments

Comments
 (0)