staging: vchiq_arm: pass vchiq instance to 'vchiq_get_client_id'

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>
This commit is contained in:
Adrien Thierry 2022-05-18 15:11:16 -04:00 committed by Greg Kroah-Hartman
parent 14780bb174
commit bad44825fb
3 changed files with 3 additions and 3 deletions

View 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;

View 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);

View 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: {