From 1efa0d2edb788406fd5e0a8150966482597b5238 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 1 Sep 2017 16:50:29 +0100 Subject: [PATCH] vcsm: Remove typedef of VC_VCHI_SM_HANDLE_T Replaced with struct sm_instance *. Signed-off-by: Dave Stevenson --- drivers/char/broadcom/vc_sm/vc_vchi_sm.c | 22 +++++++++++----------- drivers/char/broadcom/vc_sm/vc_vchi_sm.h | 22 +++++++++++----------- drivers/char/broadcom/vc_sm/vmcs_sm.c | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c index a19c0f46672f..596628063e61 100644 --- a/drivers/char/broadcom/vc_sm/vc_vchi_sm.c +++ b/drivers/char/broadcom/vc_sm/vc_vchi_sm.c @@ -250,7 +250,7 @@ static void vc_sm_vchi_callback(void *param, } } -VC_VCHI_SM_HANDLE_T vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance, +struct sm_instance *vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance, VCHI_CONNECTION_T **vchi_connections, uint32_t num_connections) { @@ -334,7 +334,7 @@ err_null: return NULL; } -int vc_vchi_sm_stop(VC_VCHI_SM_HANDLE_T *handle) +int vc_vchi_sm_stop(struct sm_instance **handle) { struct sm_instance *instance; uint32_t i; @@ -368,7 +368,7 @@ lock: return -EINVAL; } -int vc_vchi_sm_send_msg(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_send_msg(struct sm_instance *handle, enum vc_sm_msg_type msg_id, void *msg, uint32_t msg_size, void *result, uint32_t result_size, @@ -440,7 +440,7 @@ int vc_vchi_sm_send_msg(VC_VCHI_SM_HANDLE_T handle, return status; } -int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *msg, +int vc_vchi_sm_alloc(struct sm_instance *handle, struct vc_sm_alloc_t *msg, struct vc_sm_alloc_result_t *result, uint32_t *cur_trans_id) { @@ -449,14 +449,14 @@ int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *msg, cur_trans_id, 1); } -int vc_vchi_sm_free(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_free(struct sm_instance *handle, struct vc_sm_free_t *msg, uint32_t *cur_trans_id) { return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_FREE, msg, sizeof(*msg), 0, 0, cur_trans_id, 0); } -int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_lock(struct sm_instance *handle, struct vc_sm_lock_unlock_t *msg, struct vc_sm_lock_result_t *result, uint32_t *cur_trans_id) @@ -466,7 +466,7 @@ int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle, cur_trans_id, 1); } -int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_unlock(struct sm_instance *handle, struct vc_sm_lock_unlock_t *msg, uint32_t *cur_trans_id, uint8_t wait_reply) { @@ -477,27 +477,27 @@ int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle, wait_reply); } -int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_resize_t *msg, +int vc_vchi_sm_resize(struct sm_instance *handle, struct vc_sm_resize_t *msg, uint32_t *cur_trans_id) { return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_RESIZE, msg, sizeof(*msg), 0, 0, cur_trans_id, 1); } -int vc_vchi_sm_walk_alloc(VC_VCHI_SM_HANDLE_T handle) +int vc_vchi_sm_walk_alloc(struct sm_instance *handle) { return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_WALK_ALLOC, 0, 0, 0, 0, 0, 0); } -int vc_vchi_sm_clean_up(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_clean_up(struct sm_instance *handle, struct vc_sm_action_clean_t *msg) { return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_ACTION_CLEAN, msg, sizeof(*msg), 0, 0, 0, 0); } -int vc_vchi_sm_import(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_import *msg, +int vc_vchi_sm_import(struct sm_instance *handle, struct vc_sm_import *msg, struct vc_sm_import_result *result, uint32_t *cur_trans_id) { diff --git a/drivers/char/broadcom/vc_sm/vc_vchi_sm.h b/drivers/char/broadcom/vc_sm/vc_vchi_sm.h index 48e721c7f2e4..abe4ed15836f 100644 --- a/drivers/char/broadcom/vc_sm/vc_vchi_sm.h +++ b/drivers/char/broadcom/vc_sm/vc_vchi_sm.h @@ -24,26 +24,26 @@ /* * Forward declare. */ -typedef struct sm_instance *VC_VCHI_SM_HANDLE_T; +struct sm_instance; /* * Initialize the shared memory service, opens up vchi connection to talk to it. */ -VC_VCHI_SM_HANDLE_T vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance, +struct sm_instance *vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance, VCHI_CONNECTION_T **vchi_connections, uint32_t num_connections); /* * Terminates the shared memory service. */ -int vc_vchi_sm_stop(VC_VCHI_SM_HANDLE_T *handle); +int vc_vchi_sm_stop(struct sm_instance **handle); /* * Ask the shared memory service to allocate some memory on videocre and * return the result of this allocation (which upon success will be a pointer * to some memory in videocore space). */ -int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *alloc, +int vc_vchi_sm_alloc(struct sm_instance *handle, struct vc_sm_alloc_t *alloc, struct vc_sm_alloc_result_t *alloc_result, uint32_t *trans_id); @@ -51,14 +51,14 @@ int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *alloc, * Ask the shared memory service to free up some memory that was previously * allocated by the vc_vchi_sm_alloc function call. */ -int vc_vchi_sm_free(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_free(struct sm_instance *handle, struct vc_sm_free_t *free, uint32_t *trans_id); /* * Ask the shared memory service to lock up some memory that was previously * allocated by the vc_vchi_sm_alloc function call. */ -int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_lock(struct sm_instance *handle, struct vc_sm_lock_unlock_t *lock_unlock, struct vc_sm_lock_result_t *lock_result, uint32_t *trans_id); @@ -67,7 +67,7 @@ int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle, * Ask the shared memory service to unlock some memory that was previously * allocated by the vc_vchi_sm_alloc function call. */ -int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_unlock(struct sm_instance *handle, struct vc_sm_lock_unlock_t *lock_unlock, uint32_t *trans_id, uint8_t wait_reply); @@ -75,7 +75,7 @@ int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle, * Ask the shared memory service to resize some memory that was previously * allocated by the vc_vchi_sm_alloc function call. */ -int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_resize(struct sm_instance *handle, struct vc_sm_resize_t *resize, uint32_t *trans_id); /* @@ -83,19 +83,19 @@ int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle, * show up in the log. This is purely for debug/information and takes no * specific actions. */ -int vc_vchi_sm_walk_alloc(VC_VCHI_SM_HANDLE_T handle); +int vc_vchi_sm_walk_alloc(struct sm_instance *handle); /* * Clean up following a previously interrupted action which left the system * in a bad state of some sort. */ -int vc_vchi_sm_clean_up(VC_VCHI_SM_HANDLE_T handle, +int vc_vchi_sm_clean_up(struct sm_instance *handle, struct vc_sm_action_clean_t *action_clean); /* * Import a contiguous block of memory and wrap it in a GPU MEM_HANDLE_T. */ -int vc_vchi_sm_import(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_import *msg, +int vc_vchi_sm_import(struct sm_instance *handle, struct vc_sm_import *msg, struct vc_sm_import_result *result, uint32_t *cur_trans_id); diff --git a/drivers/char/broadcom/vc_sm/vmcs_sm.c b/drivers/char/broadcom/vc_sm/vmcs_sm.c index 8a089666286a..c92e2753e4c7 100644 --- a/drivers/char/broadcom/vc_sm/vmcs_sm.c +++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c @@ -181,7 +181,7 @@ struct SM_PRIV_DATA_T { */ struct SM_STATE_T { struct platform_device *pdev; - VC_VCHI_SM_HANDLE_T sm_handle; /* Handle for videocore service. */ + struct sm_instance *sm_handle; /* Handle for videocore service. */ struct dentry *dir_root; /* Debug fs entries root. */ struct dentry *dir_alloc; /* Debug fs entries allocations. */ struct SM_PDE_T dir_stats; /* Debug fs entries statistics sub-tree. */ -- 2.30.2