Commit bad44825 authored by Adrien Thierry's avatar Adrien Thierry Committed by Greg Kroah-Hartman
Browse files

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: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarAdrien Thierry <athierry@redhat.com>
Link: https://lore.kernel.org/r/20220518191126.60396-6-athierry@redhat.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14780bb1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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: {