diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-01-20 13:38:13 +0100 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2023-02-02 16:30:39 +0100 |
commit | ec47704ab3fd50a9ef8339f33139ddae4caa00b6 (patch) | |
tree | 87698ce04f75b460580dfbc637d453dbfc141c37 /kernel/ethosu_network.h | |
parent | d779a08a0f7ca3cdde16941720ddc7af96e74520 (diff) | |
download | ethos-u-linux-driver-stack-ec47704ab3fd50a9ef8339f33139ddae4caa00b6.tar.gz |
Break circulare dependency on struct ethosu_device
The 'struct ethosu_device' has been passed as argument to classes.
This creates a circular dependency dependency and it gives all
classes full visibility to all resources in the device struct. This
patch removes the circular dependency.
Using device_lock() and device_unlock() to for synchronization.
Change-Id: I8322e6530c72d7bd67f48f411b4f14b612be2706
Diffstat (limited to 'kernel/ethosu_network.h')
-rw-r--r-- | kernel/ethosu_network.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/ethosu_network.h b/kernel/ethosu_network.h index 8ee6818..e0d41b1 100644 --- a/kernel/ethosu_network.h +++ b/kernel/ethosu_network.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020,2022 Arm Limited. + * Copyright 2020,2022-2023 Arm Limited and/or its affiliates * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -33,17 +33,17 @@ ****************************************************************************/ struct ethosu_buffer; -struct ethosu_device; struct ethosu_uapi_network_create; struct device; struct file; struct ethosu_network { - struct ethosu_device *edev; - struct file *file; - struct kref kref; - struct ethosu_buffer *buf; - uint32_t index; + struct device *dev; + struct ethosu_mailbox *mailbox; + struct file *file; + struct kref kref; + struct ethosu_buffer *buf; + uint32_t index; }; /**************************************************************************** @@ -57,7 +57,8 @@ struct ethosu_network { * * Return: fd on success, else error code. */ -int ethosu_network_create(struct ethosu_device *edev, +int ethosu_network_create(struct device *dev, + struct ethosu_mailbox *mailbox, struct ethosu_uapi_network_create *uapi); /** |