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

Commit ce75fc7a authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa4: IPA PM remove callback requirement



Allow clients without callback to be registered to PM.
These clients are not expected to use any asynchronous
functions which requires a callback. In addition a sanity
check that if a callback is required from some reason,
an error will be printed to the log.

Change-Id: I407aa2dc6387263a567685797acb26999ac842d8
CRs-Fixed: 2120001
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent e13b7564
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -425,7 +425,13 @@ static void activate_work_func(struct work_struct *work)
	activate_client(client->hdl);

	mutex_lock(&ipa_pm_ctx->client_mutex);
	client->callback(client->callback_params, IPA_PM_CLIENT_ACTIVATED);
	if (client->callback) {
		client->callback(client->callback_params,
			IPA_PM_CLIENT_ACTIVATED);
	} else {
		IPA_PM_ERR("client has no callback");
		WARN_ON(1);
	}
	mutex_unlock(&ipa_pm_ctx->client_mutex);

	IPA_PM_DBG_STATE(client->hdl, client->name, client->state);
@@ -677,8 +683,7 @@ int ipa_pm_register(struct ipa_pm_register_params *params, u32 *hdl)
{
	struct ipa_pm_client *client;

	if (params == NULL || hdl == NULL || params->name == NULL
		|| params->callback == NULL) {
	if (params == NULL || hdl == NULL || params->name == NULL) {
		IPA_PM_ERR("Invalid Params\n");
		return -EINVAL;
	}
@@ -1115,9 +1120,14 @@ int ipa_pm_handle_suspend(u32 pipe_bitmask)
		if (pipe_bitmask & (1 << i)) {
			client = ipa_pm_ctx->clients_by_pipe[i];
			if (client && client_notified[client->hdl] == false) {
				client->callback(client->callback_params,
					IPA_PM_REQUEST_WAKEUP);
				if (client->callback) {
					client->callback(client->callback_params
						, IPA_PM_REQUEST_WAKEUP);
					client_notified[client->hdl] = true;
				} else {
					IPA_PM_ERR("client has no callback");
					WARN_ON(1);
				}
			}
		}
	}