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

Commit c0ff556d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 1dfbc256 69158f81
Loading
Loading
Loading
Loading
+34 −18
Original line number Diff line number Diff line
@@ -24,37 +24,53 @@

#define IPA_API_DISPATCH_RETURN(api, p...) \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			ret = -EPERM; \
		} \
		else { \
			if (ipa_api_ctrl->api) { \
				ret = ipa_api_ctrl->api(p); \
			} 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); \
				WARN_ON(1); \
				ret = -EPERM; \
			} \
		} \
	} while (0)

#define IPA_API_DISPATCH(api, p...) \
	do { \
		if (!ipa_api_ctrl) \
			pr_err("IPA HW is not supported on this target\n"); \
		else { \
			if (ipa_api_ctrl->api) { \
				ipa_api_ctrl->api(p); \
			} 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); \
				WARN_ON(1); \
			} \
		} \
	} while (0)

#define IPA_API_DISPATCH_RETURN_PTR(api, p...) \
	do { \
		if (!ipa_api_ctrl) { \
			pr_err("IPA HW is not supported on this target\n"); \
			ret = NULL; \
		} \
		else { \
			if (ipa_api_ctrl->api) { \
				ret = ipa_api_ctrl->api(p); \
			} 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); \
				WARN_ON(1); \
				ret = NULL; \
			} \
		} \
	} while (0)

static enum ipa_hw_type ipa_api_hw_type;