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

Commit 69803131 authored by Wyes Karny's avatar Wyes Karny
Browse files

msm: camera: cpas: Return error code for resource enable failure



In the case of resource enable failure we need to return the error code
to give the caller information about failure.

Change-Id: I72f3f8619445abf9a5aececfc83cf9d2d680d5d6
CRs-Fixed: 2709705
Signed-off-by: default avatarWyes Karny <wkarny@codeaurora.org>
parent fc75671c
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -1287,7 +1287,7 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
	struct cam_ahb_vote remove_ahb;
	struct cam_ahb_vote remove_ahb;
	struct cam_axi_vote axi_vote = {0};
	struct cam_axi_vote axi_vote = {0};
	enum cam_vote_level applied_level = CAM_SVS_VOTE;
	enum cam_vote_level applied_level = CAM_SVS_VOTE;
	int rc, i = 0;
	int rc, ret = 0, i = 0;
	struct cam_cpas_private_soc *soc_private = NULL;
	struct cam_cpas_private_soc *soc_private = NULL;
	bool invalid_start = true;
	bool invalid_start = true;


@@ -1441,25 +1441,26 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,


remove_axi_vote:
remove_axi_vote:
	memset(&axi_vote, 0x0, sizeof(struct cam_axi_vote));
	memset(&axi_vote, 0x0, sizeof(struct cam_axi_vote));
	rc = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	ret = cam_cpas_util_create_vote_all_paths(cpas_client, &axi_vote);
	if (rc)
	if (ret)
		CAM_ERR(CAM_CPAS, "Unable to create per path votes rc: %d", rc);
		CAM_ERR(CAM_CPAS, "Unable to create per path votes ret: %d",
			ret);


	cam_cpas_dump_axi_vote_info(cpas_client, "CPAS Start fail Vote",
	cam_cpas_dump_axi_vote_info(cpas_client, "CPAS Start fail Vote",
		&axi_vote);
		&axi_vote);


	rc = cam_cpas_util_apply_client_axi_vote(cpas_hw,
	ret = cam_cpas_util_apply_client_axi_vote(cpas_hw,
		cpas_client, &axi_vote);
		cpas_client, &axi_vote);
	if (rc)
	if (ret)
		CAM_ERR(CAM_CPAS, "Unable to remove axi votes rc: %d", rc);
		CAM_ERR(CAM_CPAS, "Unable to remove axi votes ret: %d", ret);


remove_ahb_vote:
remove_ahb_vote:
	remove_ahb.type = CAM_VOTE_ABSOLUTE;
	remove_ahb.type = CAM_VOTE_ABSOLUTE;
	remove_ahb.vote.level = CAM_SUSPEND_VOTE;
	remove_ahb.vote.level = CAM_SUSPEND_VOTE;
	rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
	ret = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
		&remove_ahb, NULL);
		&remove_ahb, NULL);
	if (rc)
	if (ret)
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, rc=%d", rc);
		CAM_ERR(CAM_CPAS, "Removing AHB vote failed, ret: %d", ret);


error:
error:
	mutex_unlock(&cpas_core->client_mutex[client_indx]);
	mutex_unlock(&cpas_core->client_mutex[client_indx]);