diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-05-18 12:40:19 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-05-21 15:42:51 -0400 |
commit | f203022353eb3e0b059a72a43762e240e9682c91 (patch) | |
tree | 976a80a352d1d06128526160be59ce03bb6da11b /drivers/firewire | |
parent | 473ffe6560fd5fa5fd5a488e8948899231972bd5 (diff) |
firewire: sbp2: use scsi_dma_(un)map
Use the scsi_dma_map/scsi_dma_unmap helper to simplify the code
a little.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/sbp2.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 2e202d3bf84d..6ffaef3307e8 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
@@ -1296,10 +1296,7 @@ static struct fw_driver sbp2_driver = { | |||
1296 | static void sbp2_unmap_scatterlist(struct device *card_device, | 1296 | static void sbp2_unmap_scatterlist(struct device *card_device, |
1297 | struct sbp2_command_orb *orb) | 1297 | struct sbp2_command_orb *orb) |
1298 | { | 1298 | { |
1299 | if (scsi_sg_count(orb->cmd)) | 1299 | scsi_dma_unmap(orb->cmd); |
1300 | dma_unmap_sg(card_device, scsi_sglist(orb->cmd), | ||
1301 | scsi_sg_count(orb->cmd), | ||
1302 | orb->cmd->sc_data_direction); | ||
1303 | 1300 | ||
1304 | if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT)) | 1301 | if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT)) |
1305 | dma_unmap_single(card_device, orb->page_table_bus, | 1302 | dma_unmap_single(card_device, orb->page_table_bus, |
@@ -1405,9 +1402,8 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb, | |||
1405 | struct scatterlist *sg = scsi_sglist(orb->cmd); | 1402 | struct scatterlist *sg = scsi_sglist(orb->cmd); |
1406 | int i, n; | 1403 | int i, n; |
1407 | 1404 | ||
1408 | n = dma_map_sg(device->card->device, sg, scsi_sg_count(orb->cmd), | 1405 | n = scsi_dma_map(orb->cmd); |
1409 | orb->cmd->sc_data_direction); | 1406 | if (n <= 0) |
1410 | if (n == 0) | ||
1411 | goto fail; | 1407 | goto fail; |
1412 | 1408 | ||
1413 | /* | 1409 | /* |
@@ -1453,8 +1449,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb, | |||
1453 | return 0; | 1449 | return 0; |
1454 | 1450 | ||
1455 | fail_page_table: | 1451 | fail_page_table: |
1456 | dma_unmap_sg(device->card->device, scsi_sglist(orb->cmd), | 1452 | scsi_dma_unmap(orb->cmd); |
1457 | scsi_sg_count(orb->cmd), orb->cmd->sc_data_direction); | ||
1458 | fail: | 1453 | fail: |
1459 | return -ENOMEM; | 1454 | return -ENOMEM; |
1460 | } | 1455 | } |