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

Commit 69158f81 authored by Ravinder Konka's avatar Ravinder Konka
Browse files

msm: ipa: Fix to handle IPA API's gracefully for non-IPA targets



Make changes to check whether IPA is initialized or not before
processing the API's.

Change-Id: Id527868c76f8d77d5dc21563ba34003e2694b5d1
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
parent 5ef36a5b
Loading
Loading
Loading
Loading
+34 −18
Original line number Original line Diff line number Diff line
@@ -24,37 +24,53 @@


#define IPA_API_DISPATCH_RETURN(api, p...) \
#define IPA_API_DISPATCH_RETURN(api, p...) \
	do { \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			ret = -EPERM; \
		} \
		else { \
			if (ipa_api_ctrl->api) { \
			if (ipa_api_ctrl->api) { \
				ret = ipa_api_ctrl->api(p); \
				ret = ipa_api_ctrl->api(p); \
			} else { \
			} else { \
			pr_err("%s not implemented for IPA HW ver %d\n", \
				pr_err("%s not implemented for IPA ver %d\n", \
						__func__, ipa_api_hw_type); \
						__func__, ipa_api_hw_type); \
				WARN_ON(1); \
				WARN_ON(1); \
				ret = -EPERM; \
				ret = -EPERM; \
			} \
			} \
		} \
	} while (0)
	} while (0)


#define IPA_API_DISPATCH(api, p...) \
#define IPA_API_DISPATCH(api, p...) \
	do { \
	do { \
		if (!ipa_api_ctrl) \
			pr_err("IPA HW is not supported on this target\n"); \
		else { \
			if (ipa_api_ctrl->api) { \
			if (ipa_api_ctrl->api) { \
				ipa_api_ctrl->api(p); \
				ipa_api_ctrl->api(p); \
			} else { \
			} else { \
			pr_err("%s not implemented for IPA HW ver %d\n", \
				pr_err("%s not implemented for IPA ver %d\n", \
						__func__, ipa_api_hw_type); \
						__func__, ipa_api_hw_type); \
				WARN_ON(1); \
				WARN_ON(1); \
			} \
			} \
		} \
	} while (0)
	} while (0)


#define IPA_API_DISPATCH_RETURN_PTR(api, p...) \
#define IPA_API_DISPATCH_RETURN_PTR(api, p...) \
	do { \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			ret = NULL; \
		} \
		else { \
			if (ipa_api_ctrl->api) { \
			if (ipa_api_ctrl->api) { \
				ret = ipa_api_ctrl->api(p); \
				ret = ipa_api_ctrl->api(p); \
			} else { \
			} else { \
			pr_err("%s not implemented for IPA HW ver %d\n", \
				pr_err("%s not implemented for IPA ver %d\n", \
						__func__, ipa_api_hw_type); \
						__func__, ipa_api_hw_type); \
				WARN_ON(1); \
				WARN_ON(1); \
				ret = NULL; \
				ret = NULL; \
			} \
			} \
		} \
	} while (0)
	} while (0)


static enum ipa_hw_type ipa_api_hw_type;
static enum ipa_hw_type ipa_api_hw_type;