diff options
author | 2024-07-19 06:07:38 +0200 | |
---|---|---|
committer | 2024-08-29 07:22:49 +0300 | |
commit | 334304ac2baca7f3e821c47cf5129d90e7a6b1e6 (patch) | |
tree | 97bf1f87e108962f636331aa4f9ac4b0a5627a96 /include/linux/dma-mapping.h | |
parent | dma-mapping: don't return errors from dma_set_seg_boundary (diff) | |
download | wireguard-linux-334304ac2baca7f3e821c47cf5129d90e7a6b1e6.tar.xz wireguard-linux-334304ac2baca7f3e821c47cf5129d90e7a6b1e6.zip |
dma-mapping: don't return errors from dma_set_max_seg_size
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 <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 6bd1333dbacb..1524da363734 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -524,13 +524,11 @@ static inline unsigned int dma_get_max_seg_size(struct device *dev) return SZ_64K; } -static inline int dma_set_max_seg_size(struct device *dev, unsigned int size) +static inline void dma_set_max_seg_size(struct device *dev, unsigned int size) { - if (dev->dma_parms) { - dev->dma_parms->max_segment_size = size; - return 0; - } - return -EIO; + if (WARN_ON_ONCE(!dev->dma_parms)) + return; + dev->dma_parms->max_segment_size = size; } static inline unsigned long dma_get_seg_boundary(struct device *dev) |