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

Commit 98176ab1 authored by Sivan Reinstein's avatar Sivan Reinstein Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: fix the return value in ipa_get_ep_mapping



The value of -1 is considered as an "unmapped" client ID to a pipe
in IPA. Even in the case of an invalid client ID, the above needs
to be returned, as it basically has the same meaning.

Change-Id: I9c2898ce9e1476a89cd866137d66f5048b5feff3
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent d4bc64ea
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ static const int ipa_ihl_ofst_meq32[] = { IPA_IHL_OFFSET_MEQ32_0,
#define IPA_2_0 (1)
#define IPA_2_6L (2)

#define INVALID_EP_MAPPING_INDEX (-1)

static const int ep_mapping[3][IPA_CLIENT_MAX] = {
	[IPA_1_1][IPA_CLIENT_HSIC1_PROD]         = 19,
	[IPA_1_1][IPA_CLIENT_WLAN1_PROD]         = -1,
@@ -865,7 +867,7 @@ int ipa_init_hw(void)
 * ipa_get_ep_mapping() - provide endpoint mapping
 * @client: client type
 *
 * Return value: endpoint mapping
 * Return value: endpoint mapping or -1 if unmapped/invalid
 */
int ipa_get_ep_mapping(enum ipa_client_type client)
{
@@ -873,7 +875,7 @@ int ipa_get_ep_mapping(enum ipa_client_type client)

	if (client >= IPA_CLIENT_MAX || client < 0) {
		IPAERR("Bad client number! client =%d\n", client);
		return -EINVAL;
		return INVALID_EP_MAPPING_INDEX;
	}

	switch (ipa_ctx->ipa_hw_type) {