scsi: smartpqi: fully convert to the generic DMA API
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Don Brace <don.brace@microchip.com> Acked-by: Don Brace <don.brace@microchip.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

vanhempi
9b7ca6c24c
commit
6917a9cc28
@@ -316,9 +316,9 @@ int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info)
|
||||
put_unaligned_le32(ctrl_info->max_io_slots,
|
||||
&base_struct->error_buffer_num_elements);
|
||||
|
||||
bus_address = pci_map_single(ctrl_info->pci_dev, base_struct,
|
||||
sizeof(*base_struct), PCI_DMA_TODEVICE);
|
||||
if (pci_dma_mapping_error(ctrl_info->pci_dev, bus_address)) {
|
||||
bus_address = dma_map_single(&ctrl_info->pci_dev->dev, base_struct,
|
||||
sizeof(*base_struct), DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&ctrl_info->pci_dev->dev, bus_address)) {
|
||||
rc = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -331,9 +331,8 @@ int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info)
|
||||
rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_INIT_BASE_STRUCT_ADDRESS,
|
||||
¶ms);
|
||||
|
||||
pci_unmap_single(ctrl_info->pci_dev, bus_address, sizeof(*base_struct),
|
||||
PCI_DMA_TODEVICE);
|
||||
|
||||
dma_unmap_single(&ctrl_info->pci_dev->dev, bus_address,
|
||||
sizeof(*base_struct), DMA_TO_DEVICE);
|
||||
out:
|
||||
kfree(base_struct_unaligned);
|
||||
|
||||
|
Viittaa uudesa ongelmassa
Block a user