vcsm: Remove typedef of VC_VCHI_SM_HANDLE_T
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Fri, 1 Sep 2017 15:50:29 +0000 (16:50 +0100)
committerpopcornmix <popcornmix@gmail.com>
Tue, 5 Sep 2017 16:45:44 +0000 (17:45 +0100)
Replaced with struct sm_instance *.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/char/broadcom/vc_sm/vc_vchi_sm.c
drivers/char/broadcom/vc_sm/vc_vchi_sm.h
drivers/char/broadcom/vc_sm/vmcs_sm.c

index a19c0f46672f5d298c38b8433b7a0ca780ea60b8..596628063e61a85e3467f6488b669f16e428d96c 100644 (file)
@@ -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)
 {
index 48e721c7f2e4ac5abe376a8481e01b0bbcc6d3ad..abe4ed15836f2be756083d3fdb4edb544dacc1a6 100644 (file)
 /*
  * 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);
 
index 8a089666286aaf787560a9eb889e022495ed9a25..c92e2753e4c73c2f8ffb1bcfc375141540a02bb3 100644 (file)
@@ -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. */