aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 70454b4e8485..1f5a07bf2a75 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2290,41 +2290,3 @@ void scsi_kunmap_atomic_sg(void *virt)
2290 kunmap_atomic(virt, KM_BIO_SRC_IRQ); 2290 kunmap_atomic(virt, KM_BIO_SRC_IRQ);
2291} 2291}
2292EXPORT_SYMBOL(scsi_kunmap_atomic_sg); 2292EXPORT_SYMBOL(scsi_kunmap_atomic_sg);
2293
2294/**
2295 * scsi_dma_map - perform DMA mapping against command's sg lists
2296 * @cmd: scsi command
2297 *
2298 * Returns the number of sg lists actually used, zero if the sg lists
2299 * is NULL, or -ENOMEM if the mapping failed.
2300 */
2301int scsi_dma_map(struct scsi_cmnd *cmd)
2302{
2303 int nseg = 0;
2304
2305 if (scsi_sg_count(cmd)) {
2306 struct device *dev = cmd->device->host->shost_gendev.parent;
2307
2308 nseg = dma_map_sg(dev, scsi_sglist(cmd), scsi_sg_count(cmd),
2309 cmd->sc_data_direction);
2310 if (unlikely(!nseg))
2311 return -ENOMEM;
2312 }
2313 return nseg;
2314}
2315EXPORT_SYMBOL(scsi_dma_map);
2316
2317/**
2318 * scsi_dma_unmap - unmap command's sg lists mapped by scsi_dma_map
2319 * @cmd: scsi command
2320 */
2321void scsi_dma_unmap(struct scsi_cmnd *cmd)
2322{
2323 if (scsi_sg_count(cmd)) {
2324 struct device *dev = cmd->device->host->shost_gendev.parent;
2325
2326 dma_unmap_sg(dev, scsi_sglist(cmd), scsi_sg_count(cmd),
2327 cmd->sc_data_direction);
2328 }
2329}
2330EXPORT_SYMBOL(scsi_dma_unmap);