From ec47704ab3fd50a9ef8339f33139ddae4caa00b6 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Fri, 20 Jan 2023 13:38:13 +0100 Subject: 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 --- kernel/ethosu_network_info.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'kernel/ethosu_network_info.h') diff --git a/kernel/ethosu_network_info.h b/kernel/ethosu_network_info.h index a809d35..8c2e659 100644 --- a/kernel/ethosu_network_info.h +++ b/kernel/ethosu_network_info.h @@ -35,12 +35,11 @@ ****************************************************************************/ struct ethosu_core_msg_network_info_rsp; -struct ethosu_device; struct ethosu_network; struct ethosu_uapi_network_info; struct ethosu_network_info { - struct ethosu_device *edev; + struct device *dev; struct ethosu_network *net; struct ethosu_uapi_network_info *uapi; struct completion done; @@ -59,13 +58,15 @@ struct ethosu_network_info { * * Return: 0 on success, . */ -int ethosu_network_info_request(struct ethosu_network *net, +int ethosu_network_info_request(struct device *dev, + struct ethosu_mailbox *mailbox, + struct ethosu_network *net, struct ethosu_uapi_network_info *uapi); /** * ethosu_network_info_rsp() - Handle network info response. */ -void ethosu_network_info_rsp(struct ethosu_device *edev, +void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox, int msg_id, struct ethosu_core_msg_network_info_rsp *rsp); -- cgit v1.2.1