media: ipu6: make the ipu6_mmu_unmap() as a void function

The DMA unmap API is not supposed to return value. Thus this patch
changes the ipu6_mmu_unmap() as a void function and DMA unmapping
didn't check the return value.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
[Sakari Ailus: Drop unnecessary returns.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
Bingbu Cao 2024-11-05 10:45:08 +08:00 committed by Hans Verkuil
parent 1faf84ff1c
commit 7af76aa153
2 changed files with 11 additions and 12 deletions

View File

@ -254,8 +254,8 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info)
return pt;
}
static size_t l2_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
phys_addr_t dummy, size_t size)
static void l2_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
phys_addr_t dummy, size_t size)
{
unsigned int l2_entries;
unsigned int l2_idx;
@ -301,7 +301,6 @@ static size_t l2_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
WARN_ON_ONCE(size);
spin_unlock_irqrestore(&mmu_info->lock, flags);
return l2_entries << ISP_PAGE_SHIFT;
}
static int l2_map(struct ipu6_mmu_info *mmu_info, unsigned long iova,
@ -406,10 +405,10 @@ static int __ipu6_mmu_map(struct ipu6_mmu_info *mmu_info, unsigned long iova,
return l2_map(mmu_info, iova_start, paddr, size);
}
static size_t __ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info,
unsigned long iova, size_t size)
static void __ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info,
unsigned long iova, size_t size)
{
return l2_unmap(mmu_info, iova, 0, size);
l2_unmap(mmu_info, iova, 0, size);
}
static int allocate_trash_buffer(struct ipu6_mmu *mmu)
@ -650,8 +649,8 @@ phys_addr_t ipu6_mmu_iova_to_phys(struct ipu6_mmu_info *mmu_info,
return phy_addr;
}
size_t ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
size_t size)
void ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
size_t size)
{
unsigned int min_pagesz;
@ -668,10 +667,10 @@ size_t ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
if (!IS_ALIGNED(iova | size, min_pagesz)) {
dev_err(NULL, "unaligned: iova 0x%lx size 0x%zx min_pagesz 0x%x\n",
iova, size, min_pagesz);
return 0;
return;
}
return __ipu6_mmu_unmap(mmu_info, iova, size);
__ipu6_mmu_unmap(mmu_info, iova, size);
}
int ipu6_mmu_map(struct ipu6_mmu_info *mmu_info, unsigned long iova,

View File

@ -66,8 +66,8 @@ int ipu6_mmu_hw_init(struct ipu6_mmu *mmu);
void ipu6_mmu_hw_cleanup(struct ipu6_mmu *mmu);
int ipu6_mmu_map(struct ipu6_mmu_info *mmu_info, unsigned long iova,
phys_addr_t paddr, size_t size);
size_t ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
size_t size);
void ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
size_t size);
phys_addr_t ipu6_mmu_iova_to_phys(struct ipu6_mmu_info *mmu_info,
dma_addr_t iova);
#endif