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

Commit 04b5d1cd authored by Kuirong Wang's avatar Kuirong Wang
Browse files

ASoC: wcd_cpe: Update the logic to check for null pointer



Update the code to make the logic for the null pointer
more readable and easy to understand.

Change-Id: I53a8b7404610172a4726846b8bce8e86f72b4854
Signed-off-by: default avatarKuirong Wang <kuirongw@codeaurora.org>
parent c5564588
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -962,14 +962,18 @@ static void wcd_cpe_svc_event_cb(const struct cpe_svc_notification *param)
	}

	codec = param->private_data;

	if (!codec || !wcd_cpe_get_core_handle(codec)) {
		pr_err("%s: Invalid handle to codec/core\n",
	if (!codec) {
		pr_err("%s: Invalid handle to codec\n",
			__func__);
		return;
	}

	core = wcd_cpe_get_core_handle(codec);
	if (!core) {
		pr_err("%s: Invalid handle to core\n",
			__func__);
		return;
	}

	dev_dbg(core->dev,
		"%s: event = 0x%x\n", __func__, param->event);