Skip to content

Commit 560a861

Browse files
author
Christoph Hellwig
committed
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: Christoph Hellwig <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]>
1 parent c42a012 commit 560a861

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/linux/dma-mapping.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,11 @@ static inline unsigned long dma_get_seg_boundary_nr_pages(struct device *dev,
559559
return (dma_get_seg_boundary(dev) >> page_shift) + 1;
560560
}
561561

562-
static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
562+
static inline void dma_set_seg_boundary(struct device *dev, unsigned long mask)
563563
{
564-
if (dev->dma_parms) {
565-
dev->dma_parms->segment_boundary_mask = mask;
566-
return 0;
567-
}
568-
return -EIO;
564+
if (WARN_ON_ONCE(!dev->dma_parms))
565+
return;
566+
dev->dma_parms->segment_boundary_mask = mask;
569567
}
570568

571569
static inline unsigned int dma_get_min_align_mask(struct device *dev)

0 commit comments

Comments
 (0)