aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_buffer.h
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2023-01-20 13:38:13 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2023-02-02 16:30:39 +0100
commitec47704ab3fd50a9ef8339f33139ddae4caa00b6 (patch)
tree87698ce04f75b460580dfbc637d453dbfc141c37 /kernel/ethosu_buffer.h
parentd779a08a0f7ca3cdde16941720ddc7af96e74520 (diff)
downloadethos-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_buffer.h')
-rw-r--r--kernel/ethosu_buffer.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/ethosu_buffer.h b/kernel/ethosu_buffer.h
index ada8c4c..bc5958c 100644
--- a/kernel/ethosu_buffer.h
+++ b/kernel/ethosu_buffer.h
@@ -50,15 +50,14 @@ struct device;
* 'offset + size' must not be larger than 'capacity'.
*/
struct ethosu_buffer {
- struct ethosu_device *edev;
- struct device *dev;
- struct file *file;
- struct kref kref;
- size_t capacity;
- size_t offset;
- size_t size;
- void *cpu_addr;
- dma_addr_t dma_addr;
+ struct device *dev;
+ struct file *file;
+ struct kref kref;
+ size_t capacity;
+ size_t offset;
+ size_t size;
+ void *cpu_addr;
+ dma_addr_t dma_addr;
};
/****************************************************************************
@@ -72,7 +71,7 @@ struct ethosu_buffer {
*
* Return: fd on success, else error code.
*/
-int ethosu_buffer_create(struct ethosu_device *edev,
+int ethosu_buffer_create(struct device *dev,
size_t capacity);
/**