static void sdmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, int err) { struct realtek_pci_sdmmc *host = mmc_priv(mmc); struct rtsx_pcr *pcr = host->pcr; struct mmc_data *data = mrq->data; int read = data->flags & MMC_DATA_READ; rtsx_pci_dma_unmap_sg(pcr, data->sg, data->sg_len, read); data->host_cookie = 0; }
int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, int num_sg, bool read, int timeout) { int err = 0, count; pcr_dbg(pcr, "--> %s: num_sg = %d\n", __func__, num_sg); count = rtsx_pci_dma_map_sg(pcr, sglist, num_sg, read); if (count < 1) return -EINVAL; pcr_dbg(pcr, "DMA mapping count: %d\n", count); err = rtsx_pci_dma_transfer(pcr, sglist, count, read, timeout); rtsx_pci_dma_unmap_sg(pcr, sglist, num_sg, read); return err; }