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

Commit 08161231 authored by Anant Goel's avatar Anant Goel Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: pil: Refine error handling for SCM ICC client



A NULL return for ICC get is valid for platforms where
CONFIG_INTERCONNECT is not defined. Refine the error handling
for the scm perf client to allow a NULL value.

Change-Id: I714a9091000e99aecb466a54968a140868659410
Signed-off-by: default avatarAnant Goel <anantg@codeaurora.org>
parent 84df7e40
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ enum pas_id {
static struct icc_path *scm_perf_client;
static int scm_pas_bw_count;
static DEFINE_MUTEX(scm_pas_bw_mutex);
static int is_inited;

static void subsys_disable_all_irqs(struct pil_tz_data *d);
static void subsys_enable_all_irqs(struct pil_tz_data *d);
@@ -180,7 +181,7 @@ static int scm_pas_enable_bw(void)
{
	int ret = 0;

	if (!scm_perf_client)
	if (IS_ERR(scm_perf_client))
		return -EINVAL;

	mutex_lock(&scm_pas_bw_mutex);
@@ -1344,7 +1345,7 @@ static int pil_tz_generic_probe(struct platform_device *pdev)
	 * is not yet registered. Return error if that driver returns with
	 * any error other than EPROBE_DEFER.
	 */
	if (!scm_perf_client)
	if (!is_inited)
		return -EPROBE_DEFER;
	if (IS_ERR(scm_perf_client))
		return PTR_ERR(scm_perf_client);
@@ -1582,6 +1583,7 @@ static int pil_tz_scm_pas_probe(struct platform_device *pdev)
		ret = PTR_ERR(scm_perf_client);
		pr_err("scm-pas: Unable to register bus client: %d\n", ret);
	}
	is_inited = 1;

	return ret;
}