aboutsummaryrefslogtreecommitdiff
path: root/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-12 09:56:56 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-12 13:28:26 +0100
commit16be28550f0906e2bfff20b94dd373f59b4a2ccf (patch)
tree72ac8fa23cccacc5db2f4e08e31659eaed60ad51 /kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
parentd4ad9e55cb8e17a4a42b3a94c64e6bc48529b26e (diff)
downloadethos-u-linux-driver-stack-16be28550f0906e2bfff20b94dd373f59b4a2ccf.tar.gz
Rename macros and types to namespace their usage
Macros and types have been renamed accordingly to namespace them by their usage in the new kernel driver source tree structure. This is done in a separate commit from the restructuring to avoid Git from seeing some of the moved files as new ones because they have been both moved and modified at the same time and thus losing the connection in the history. Change-Id: Icd4d8e8c76779479b5b46a55bf1d4f78a629c281 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/rpmsg/ethosu_rpmsg_cancel_inference.c')
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_cancel_inference.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
index 5d46434..5fa7515 100644
--- a/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
+++ b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
@@ -41,18 +41,19 @@
* Functions
****************************************************************************/
-static int ethosu_cancel_inference_send(
- struct ethosu_cancel_inference *cancellation,
- struct ethosu_mailbox *mailbox)
+static int ethosu_rpmsg_cancel_inference_send(
+ struct ethosu_rpmsg_cancel_inference *cancellation,
+ struct ethosu_rpmsg_mailbox *mailbox)
{
- return ethosu_mailbox_cancel_inference(mailbox,
- &cancellation->msg,
- cancellation->inf->msg.id);
+ return ethosu_rpmsg_mailbox_cancel_inference(mailbox,
+ &cancellation->msg,
+ cancellation->inf->msg.id);
}
-static void ethosu_cancel_inference_fail(struct ethosu_mailbox_msg *msg)
+static void ethosu_rpmsg_cancel_inference_fail(
+ struct ethosu_rpmsg_mailbox_msg *msg)
{
- struct ethosu_cancel_inference *cancellation =
+ struct ethosu_rpmsg_cancel_inference *cancellation =
container_of(msg, typeof(*cancellation), msg);
if (completion_done(&cancellation->done))
@@ -63,12 +64,12 @@ static void ethosu_cancel_inference_fail(struct ethosu_mailbox_msg *msg)
complete(&cancellation->done);
}
-int ethosu_cancel_inference_request(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_inference *inf,
- struct ethosu_uapi_cancel_inference_status *uapi)
+int ethosu_rpmsg_cancel_inference_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_rpmsg_inference *inf,
+ struct ethosu_uapi_cancel_inference_status *uapi)
{
- struct ethosu_cancel_inference *cancellation;
+ struct ethosu_rpmsg_cancel_inference *cancellation;
int ret;
int timeout;
@@ -80,13 +81,13 @@ int ethosu_cancel_inference_request(struct device *dev,
cancellation =
devm_kzalloc(dev,
- sizeof(struct ethosu_cancel_inference),
+ sizeof(struct ethosu_rpmsg_cancel_inference),
GFP_KERNEL);
if (!cancellation)
return -ENOMEM;
/* increase ref count on the inference we are refering to */
- ethosu_inference_get(inf);
+ ethosu_rpmsg_inference_get(inf);
/* mark inference ABORTING to avoid resending the inference message */
inf->status = ETHOSU_UAPI_STATUS_ABORTING;
@@ -94,10 +95,10 @@ int ethosu_cancel_inference_request(struct device *dev,
cancellation->inf = inf;
cancellation->uapi = uapi;
init_completion(&cancellation->done);
- cancellation->msg.fail = ethosu_cancel_inference_fail;
+ cancellation->msg.fail = ethosu_rpmsg_cancel_inference_fail;
- ret = ethosu_mailbox_register(mailbox,
- &cancellation->msg);
+ ret = ethosu_rpmsg_mailbox_register(mailbox,
+ &cancellation->msg);
if (ret < 0)
goto kfree;
@@ -105,7 +106,7 @@ int ethosu_cancel_inference_request(struct device *dev,
"Inference cancellation create. cancel=0x%pK, msg.id=%ddev",
cancellation, cancellation->msg.id);
- ret = ethosu_cancel_inference_send(cancellation, mailbox);
+ ret = ethosu_rpmsg_cancel_inference_send(cancellation, mailbox);
if (0 != ret)
goto deregister;
@@ -140,30 +141,30 @@ int ethosu_cancel_inference_request(struct device *dev,
inf->status = ETHOSU_UAPI_STATUS_ABORTED;
deregister:
- ethosu_mailbox_deregister(mailbox,
- &cancellation->msg);
+ ethosu_rpmsg_mailbox_deregister(mailbox,
+ &cancellation->msg);
kfree:
dev_dbg(dev,
"Cancel inference destroy. cancel=0x%pK", cancellation);
/* decrease the reference on the inference we are refering to */
- ethosu_inference_put(cancellation->inf);
+ ethosu_rpmsg_inference_put(cancellation->inf);
devm_kfree(dev, cancellation);
return ret;
}
-void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_cancel_inference_rsp *rsp)
+void ethosu_rpmsg_cancel_inference_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_cancel_inference_rsp *rsp)
{
struct device *dev = mailbox->dev;
- struct ethosu_mailbox_msg *msg;
- struct ethosu_cancel_inference *cancellation;
+ struct ethosu_rpmsg_mailbox_msg *msg;
+ struct ethosu_rpmsg_cancel_inference *cancellation;
- msg = ethosu_mailbox_find(mailbox, msg_id,
- ETHOSU_CORE_MSG_CANCEL_INFERENCE_REQ);
+ msg = ethosu_rpmsg_mailbox_find(mailbox, msg_id,
+ ETHOSU_RPMSG_CANCEL_INFERENCE_REQ);
if (IS_ERR(msg)) {
dev_warn(dev,
"Id for cancel inference msg not found. Id=0x%x: %ld",
@@ -179,10 +180,10 @@ void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox,
cancellation->errno = 0;
switch (rsp->status) {
- case ETHOSU_CORE_STATUS_OK:
+ case ETHOSU_RPMSG_STATUS_OK:
cancellation->uapi->status = ETHOSU_UAPI_STATUS_OK;
break;
- case ETHOSU_CORE_STATUS_ERROR:
+ case ETHOSU_RPMSG_STATUS_ERROR:
cancellation->uapi->status = ETHOSU_UAPI_STATUS_ERROR;
break;
}