Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
mmc: android-goldfish: use sg_copy_{from,to}_buffer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and storulf committed May 21, 2018
1 parent 65f9e20 commit 53d7e09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/mmc/host/android-goldfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
* We don't really have DMA, so we need
* to copy from our platform driver buffer
*/
uint8_t *dest = (uint8_t *)sg_virt(data->sg);
memcpy(dest, host->virt_base, data->sg->length);
sg_copy_to_buffer(data->sg, 1, host->virt_base,
data->sg->length);
}
host->data->bytes_xfered += data->sg->length;
dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len,
Expand Down Expand Up @@ -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
* platform driver buffer
*/
const uint8_t *src = (uint8_t *)sg_virt(data->sg);
memcpy(host->virt_base, src, data->sg->length);
sg_copy_from_buffer(data->sg, 1, host->virt_base,
data->sg->length);
}
}

Expand Down

0 comments on commit 53d7e09

Please sign in to comment.