Commit fb212ad6 authored by Jordan Crouse's avatar Jordan Crouse Committed by Rob Clark

drm/msm: Update the MMU helper function APIs

Instead of using a bare unsigned type for the length value for map/unmap
functions pass in a size_t to more correctly match up with the underlying
APIs.
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Tested-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent ccac7ce3
...@@ -26,7 +26,7 @@ static void msm_gpummu_detach(struct msm_mmu *mmu) ...@@ -26,7 +26,7 @@ static void msm_gpummu_detach(struct msm_mmu *mmu)
} }
static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova,
struct sg_table *sgt, unsigned len, int prot) struct sg_table *sgt, size_t len, int prot)
{ {
struct msm_gpummu *gpummu = to_msm_gpummu(mmu); struct msm_gpummu *gpummu = to_msm_gpummu(mmu);
unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE;
...@@ -54,7 +54,7 @@ static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, ...@@ -54,7 +54,7 @@ static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova,
return 0; return 0;
} }
static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len) static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len)
{ {
struct msm_gpummu *gpummu = to_msm_gpummu(mmu); struct msm_gpummu *gpummu = to_msm_gpummu(mmu);
unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE;
......
...@@ -31,7 +31,7 @@ static void msm_iommu_detach(struct msm_mmu *mmu) ...@@ -31,7 +31,7 @@ static void msm_iommu_detach(struct msm_mmu *mmu)
} }
static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
struct sg_table *sgt, unsigned len, int prot) struct sg_table *sgt, size_t len, int prot)
{ {
struct msm_iommu *iommu = to_msm_iommu(mmu); struct msm_iommu *iommu = to_msm_iommu(mmu);
size_t ret; size_t ret;
...@@ -42,7 +42,7 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, ...@@ -42,7 +42,7 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
return (ret == len) ? 0 : -EINVAL; return (ret == len) ? 0 : -EINVAL;
} }
static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len) static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len)
{ {
struct msm_iommu *iommu = to_msm_iommu(mmu); struct msm_iommu *iommu = to_msm_iommu(mmu);
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
struct msm_mmu_funcs { struct msm_mmu_funcs {
void (*detach)(struct msm_mmu *mmu); void (*detach)(struct msm_mmu *mmu);
int (*map)(struct msm_mmu *mmu, uint64_t iova, struct sg_table *sgt, int (*map)(struct msm_mmu *mmu, uint64_t iova, struct sg_table *sgt,
unsigned len, int prot); size_t len, int prot);
int (*unmap)(struct msm_mmu *mmu, uint64_t iova, unsigned len); int (*unmap)(struct msm_mmu *mmu, uint64_t iova, size_t len);
void (*destroy)(struct msm_mmu *mmu); void (*destroy)(struct msm_mmu *mmu);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment