Commit 560a861a authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-mapping: don't return errors from dma_set_seg_boundary



A NULL dev->dma_parms indicates either a bus that is not DMA capable or
grave bug in the implementation of the bus code.

There isn't much the driver can do in terms of error handling for either
case, so just warn and continue as DMA operations will fail anyway.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c42a0126
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -559,13 +559,11 @@ static inline unsigned long dma_get_seg_boundary_nr_pages(struct device *dev,
	return (dma_get_seg_boundary(dev) >> page_shift) + 1;
}

static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
static inline void dma_set_seg_boundary(struct device *dev, unsigned long mask)
{
	if (dev->dma_parms) {
	if (WARN_ON_ONCE(!dev->dma_parms))
		return;
	dev->dma_parms->segment_boundary_mask = mask;
		return 0;
	}
	return -EIO;
}

static inline unsigned int dma_get_min_align_mask(struct device *dev)