staging: vchiq_arm: pass vchiq instance to 'vchiq_get_client_id'
authorAdrien Thierry <athierry@redhat.com>
Wed, 18 May 2022 19:11:16 +0000 (15:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:03:46 +0000 (08:03 +0200)
In order to remove the 'vchiq_states' global array, we need to pass the
vchiq_instance reference to the 'handle_to_service' function, as well as
to all functions that call 'handle_to_service'. This will allow
accessing the vchiq state through the vchiq instance instead of through
the global array.

'handle_to_service' is called by 'vchiq_get_client_id'. Therefore, pass
the vchiq instance reference to it.

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Adrien Thierry <athierry@redhat.com>
Link: https://lore.kernel.org/r/20220518191126.60396-6-athierry@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

index 7217e30..d6853e2 100644 (file)
@@ -398,7 +398,7 @@ vchiq_service_put(struct vchiq_service *service)
 }
 
 int
-vchiq_get_client_id(unsigned int handle)
+vchiq_get_client_id(struct vchiq_instance *instance, unsigned int handle)
 {
        struct vchiq_service *service;
        int id;
index 34d8fef..c08d1f8 100644 (file)
@@ -598,7 +598,7 @@ void vchiq_log_dump_mem(const char *label, u32 addr, const void *void_mem, size_
 
 enum vchiq_status vchiq_remove_service(struct vchiq_instance *instance, unsigned int service);
 
-int vchiq_get_client_id(unsigned int service);
+int vchiq_get_client_id(struct vchiq_instance *instance, unsigned int service);
 
 void vchiq_get_config(struct vchiq_config *config);
 
index adb616d..7e29749 100644 (file)
@@ -788,7 +788,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case VCHIQ_IOC_GET_CLIENT_ID: {
                unsigned int handle = (unsigned int)arg;
 
-               ret = vchiq_get_client_id(handle);
+               ret = vchiq_get_client_id(instance, handle);
        } break;
 
        case VCHIQ_IOC_GET_CONFIG: {