Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sata_sil24: use dma_set_mask_and_coherent

Use the dma_set_mask_and_coherent helper to set the DMA mask. Rely
on the relatively recent change that setting a larger than required
mask will never fail to avoid the need for the boilerplate 32-bit
fallback code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
dcc02c19 440bd77f

+4 -22
+4 -22
drivers/ata/sata_sil24.c
··· 1301 1301 host->iomap = iomap; 1302 1302 1303 1303 /* configure and activate the device */ 1304 - if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { 1305 - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); 1306 - if (rc) { 1307 - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); 1308 - if (rc) { 1309 - dev_err(&pdev->dev, 1310 - "64-bit DMA enable failed\n"); 1311 - return rc; 1312 - } 1313 - } 1314 - } else { 1315 - rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); 1316 - if (rc) { 1317 - dev_err(&pdev->dev, "32-bit DMA enable failed\n"); 1318 - return rc; 1319 - } 1320 - rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); 1321 - if (rc) { 1322 - dev_err(&pdev->dev, 1323 - "32-bit consistent DMA enable failed\n"); 1324 - return rc; 1325 - } 1304 + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); 1305 + if (rc) { 1306 + dev_err(&pdev->dev, "DMA enable failed\n"); 1307 + return rc; 1326 1308 } 1327 1309 1328 1310 /* Set max read request size to 4096. This slightly increases