mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
LinuxKPI: add DMA_MAPPING_ERROR
While we deal with 0 returned, some drivers directly use and check for DMA_MAPPING_ERROR. Add the case and check for both in dma_mapping_error(). MFC after: 1 week Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36686
This commit is contained in:
parent
f486b35247
commit
0b9bc97342
1 changed files with 5 additions and 1 deletions
|
|
@ -288,11 +288,15 @@ dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
|
|||
{
|
||||
}
|
||||
|
||||
#define DMA_MAPPING_ERROR (~(dma_addr_t)0)
|
||||
|
||||
static inline int
|
||||
dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
|
||||
{
|
||||
|
||||
return (dma_addr == 0);
|
||||
if (dma_addr == 0 || dma_addr == DMA_MAPPING_ERROR)
|
||||
return (-ENOMEM);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline unsigned int dma_set_max_seg_size(struct device *dev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue