@@ -1862,11 +1862,9 @@ static int exec_drive_taskfile(struct driver_data *dd,
1862
1862
if (IS_ERR (outbuf ))
1863
1863
return PTR_ERR (outbuf );
1864
1864
1865
- outbuf_dma = pci_map_single (dd -> pdev ,
1866
- outbuf ,
1867
- taskout ,
1868
- DMA_TO_DEVICE );
1869
- if (pci_dma_mapping_error (dd -> pdev , outbuf_dma )) {
1865
+ outbuf_dma = dma_map_single (& dd -> pdev -> dev , outbuf ,
1866
+ taskout , DMA_TO_DEVICE );
1867
+ if (dma_mapping_error (& dd -> pdev -> dev , outbuf_dma )) {
1870
1868
err = - ENOMEM ;
1871
1869
goto abort ;
1872
1870
}
@@ -1880,10 +1878,9 @@ static int exec_drive_taskfile(struct driver_data *dd,
1880
1878
inbuf = NULL ;
1881
1879
goto abort ;
1882
1880
}
1883
- inbuf_dma = pci_map_single (dd -> pdev ,
1884
- inbuf ,
1885
- taskin , DMA_FROM_DEVICE );
1886
- if (pci_dma_mapping_error (dd -> pdev , inbuf_dma )) {
1881
+ inbuf_dma = dma_map_single (& dd -> pdev -> dev , inbuf ,
1882
+ taskin , DMA_FROM_DEVICE );
1883
+ if (dma_mapping_error (& dd -> pdev -> dev , inbuf_dma )) {
1887
1884
err = - ENOMEM ;
1888
1885
goto abort ;
1889
1886
}
@@ -2002,11 +1999,11 @@ static int exec_drive_taskfile(struct driver_data *dd,
2002
1999
2003
2000
/* reclaim the DMA buffers.*/
2004
2001
if (inbuf_dma )
2005
- pci_unmap_single ( dd -> pdev , inbuf_dma ,
2006
- taskin , DMA_FROM_DEVICE );
2002
+ dma_unmap_single ( & dd -> pdev -> dev , inbuf_dma , taskin ,
2003
+ DMA_FROM_DEVICE );
2007
2004
if (outbuf_dma )
2008
- pci_unmap_single ( dd -> pdev , outbuf_dma ,
2009
- taskout , DMA_TO_DEVICE );
2005
+ dma_unmap_single ( & dd -> pdev -> dev , outbuf_dma , taskout ,
2006
+ DMA_TO_DEVICE );
2010
2007
inbuf_dma = 0 ;
2011
2008
outbuf_dma = 0 ;
2012
2009
@@ -2053,11 +2050,11 @@ static int exec_drive_taskfile(struct driver_data *dd,
2053
2050
}
2054
2051
abort :
2055
2052
if (inbuf_dma )
2056
- pci_unmap_single ( dd -> pdev , inbuf_dma ,
2057
- taskin , DMA_FROM_DEVICE );
2053
+ dma_unmap_single ( & dd -> pdev -> dev , inbuf_dma , taskin ,
2054
+ DMA_FROM_DEVICE );
2058
2055
if (outbuf_dma )
2059
- pci_unmap_single ( dd -> pdev , outbuf_dma ,
2060
- taskout , DMA_TO_DEVICE );
2056
+ dma_unmap_single ( & dd -> pdev -> dev , outbuf_dma , taskout ,
2057
+ DMA_TO_DEVICE );
2061
2058
kfree (outbuf );
2062
2059
kfree (inbuf );
2063
2060
@@ -4216,18 +4213,10 @@ static int mtip_pci_probe(struct pci_dev *pdev,
4216
4213
goto iomap_err ;
4217
4214
}
4218
4215
4219
- if (!pci_set_dma_mask (pdev , DMA_BIT_MASK (64 ))) {
4220
- rv = pci_set_consistent_dma_mask (pdev , DMA_BIT_MASK (64 ));
4221
-
4222
- if (rv ) {
4223
- rv = pci_set_consistent_dma_mask (pdev ,
4224
- DMA_BIT_MASK (32 ));
4225
- if (rv ) {
4226
- dev_warn (& pdev -> dev ,
4227
- "64-bit DMA enable failed\n" );
4228
- goto setmask_err ;
4229
- }
4230
- }
4216
+ rv = dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (64 ));
4217
+ if (rv ) {
4218
+ dev_warn (& pdev -> dev , "64-bit DMA enable failed\n" );
4219
+ goto setmask_err ;
4231
4220
}
4232
4221
4233
4222
/* Copy the info we may need later into the private data structure. */
0 commit comments