diff options
Diffstat (limited to 'drivers/acpi/arm64/dma.c')
| -rw-r--r-- | drivers/acpi/arm64/dma.c | 9 | 
1 files changed, 3 insertions, 6 deletions
| diff --git a/drivers/acpi/arm64/dma.c b/drivers/acpi/arm64/dma.c index 93d796531af3..b98a149f8d50 100644 --- a/drivers/acpi/arm64/dma.c +++ b/drivers/acpi/arm64/dma.c @@ -8,7 +8,6 @@ void acpi_arch_dma_setup(struct device *dev)  {  	int ret;  	u64 end, mask; -	u64 size = 0;  	const struct bus_dma_region *map = NULL;  	/* @@ -23,9 +22,9 @@ void acpi_arch_dma_setup(struct device *dev)  	}  	if (dev->coherent_dma_mask) -		size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1); +		end = dev->coherent_dma_mask;  	else -		size = 1ULL << 32; +		end = (1ULL << 32) - 1;  	ret = acpi_dma_get_range(dev, &map);  	if (!ret && map) { @@ -36,18 +35,16 @@ void acpi_arch_dma_setup(struct device *dev)  				end = r->dma_start + r->size - 1;  		} -		size = end + 1;  		dev->dma_range_map = map;  	}  	if (ret == -ENODEV) -		ret = iort_dma_get_ranges(dev, &size); +		ret = iort_dma_get_ranges(dev, &end);  	if (!ret) {  		/*  		 * Limit coherent and dma mask based on size retrieved from  		 * firmware.  		 */ -		end = size - 1;  		mask = DMA_BIT_MASK(ilog2(end) + 1);  		dev->bus_dma_limit = end;  		dev->coherent_dma_mask = min(dev->coherent_dma_mask, mask); | 
