Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ecbb939 authored by Pavan Kumar Chilamkurthi's avatar Pavan Kumar Chilamkurthi
Browse files

msm: camera: memmgr: Allow alloc flags with 0



Allocation flags need not be non-zero. In cases
where only allocation is required without mapping
the buffer to hw or kmd, flags can be 0.

Change-Id: Ia2b290ee0a3353ccac36f8aca569aa4edd48593f
Signed-off-by: default avatarPavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
parent 0ca37117
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -442,13 +442,8 @@ static int cam_mem_util_ion_alloc(struct cam_mem_mgr_alloc_cmd *cmd,
}


static int cam_mem_util_check_flags(struct cam_mem_mgr_alloc_cmd *cmd)
static int cam_mem_util_check_alloc_flags(struct cam_mem_mgr_alloc_cmd *cmd)
{
	if (!cmd->flags) {
		CAM_ERR(CAM_MEM, "Invalid flags");
		return -EINVAL;
	}

	if (cmd->num_hdl > CAM_MEM_MMU_MAX_HANDLE) {
		CAM_ERR(CAM_MEM, "Num of mmu hdl exceeded maximum(%d)",
			CAM_MEM_MMU_MAX_HANDLE);
@@ -571,7 +566,7 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd)
	}
	len = cmd->len;

	rc = cam_mem_util_check_flags(cmd);
	rc = cam_mem_util_check_alloc_flags(cmd);
	if (rc) {
		CAM_ERR(CAM_MEM, "Invalid flags: flags = %X", cmd->flags);
		return rc;