aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_device.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_device.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_device.h')
-rw-r--r--kernel/ethosu_device.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/ethosu_device.h b/kernel/ethosu_device.h
index cc4271d..d02f29d 100644
--- a/kernel/ethosu_device.h
+++ b/kernel/ethosu_device.h
@@ -42,13 +42,11 @@
* struct ethosu_device - Device structure
*/
struct ethosu_device {
- struct device *dev;
struct rpmsg_device *rpdev;
struct rpmsg_endpoint *ept;
struct cdev cdev;
struct class *class;
dev_t devt;
- struct mutex mutex;
struct ethosu_mailbox mailbox;
};
@@ -61,14 +59,13 @@ struct ethosu_device {
*
* Return: 0 on success, else error code.
*/
-int ethosu_dev_init(struct ethosu_device *edev,
- struct rpmsg_device *rpdev,
+int ethosu_dev_init(struct rpmsg_device *rpdev,
struct class *class,
dev_t devt);
/**
* ethosu_dev_deinit() - Initialize the device
*/
-void ethosu_dev_deinit(struct ethosu_device *edev);
+void ethosu_dev_deinit(struct rpmsg_device *rpdev);
#endif /* ETHOSU_DEVICE_H */