mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
scsi: dma-mapping: Make dma_max_mapping_size() return 0 for no DMA capability
For when a device is not DMA capable, the max mapping size would be 0, so make dma_max_mapping_size() reflect that. Signed-off-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260629085310.2298552-2-john.g.garry@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
98575b9ffc
commit
81d273096f
|
|
@ -979,6 +979,9 @@ size_t dma_max_mapping_size(struct device *dev)
|
|||
const struct dma_map_ops *ops = get_dma_ops(dev);
|
||||
size_t size = SIZE_MAX;
|
||||
|
||||
if (!dev->dma_mask)
|
||||
return 0;
|
||||
|
||||
if (dma_map_direct(dev, ops))
|
||||
size = dma_direct_max_mapping_size(dev);
|
||||
else if (use_dma_iommu(dev))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user