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

Commit 7c0057d1 authored by Prasad Sodagudi's avatar Prasad Sodagudi
Browse files

drivers: soc: Fix error code mismatch



SCM error codes are not in sync with secure world error
codes. Address the error code mismatch and return proper
error codes for failure cases.

Change-Id: Icb0b72c02317a19f23b5b742ef6d9fe68e74bf88
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent f74ff626
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2010-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -20,13 +20,11 @@
#define CREATE_TRACE_POINTS
#include <trace/events/scm.h>

#define SCM_ENOMEM		-5
#define SCM_EOPNOTSUPP		-4
#define SCM_ENOMEM		-9
#define SCM_EINVAL_ADDR		-3
#define SCM_EINVAL_ARG		-2
#define SCM_ERROR		-1
#define SCM_INTERRUPTED		1
#define SCM_EBUSY		-55
#define SCM_V2_EBUSY		-12

static DEFINE_MUTEX(scm_lock);
@@ -81,15 +79,12 @@ static int scm_remap_error(int err)
{
	switch (err) {
	case SCM_ERROR:
		return -EIO;
		return -EOPNOTSUPP;
	case SCM_EINVAL_ADDR:
	case SCM_EINVAL_ARG:
		return -EINVAL;
	case SCM_EOPNOTSUPP:
		return -EOPNOTSUPP;
	case SCM_ENOMEM:
		return -ENOMEM;
	case SCM_EBUSY:
	case SCM_V2_EBUSY:
		return -EBUSY;
	}