SPM: Remove the tfm_spm_get_msg_buffer_from_conn_handle

Change-Id: Iceca59ffd4461764ffae2832ad34dd03854dfb76
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.c b/secure_fw/spm/cmsis_psa/spm_ipc.c
index 9c0e2de..f421405 100755
--- a/secure_fw/spm/cmsis_psa/spm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.c
@@ -401,14 +401,6 @@
     return p_msg;
 }
 
-struct tfm_msg_body_t *
- tfm_spm_get_msg_buffer_from_conn_handle(struct tfm_conn_handle_t *conn_handle)
-{
-    TFM_CORE_ASSERT(conn_handle != NULL);
-
-    return &(conn_handle->internal_msg);
-}
-
 void tfm_spm_fill_msg(struct tfm_msg_body_t *msg,
                       struct service_t *service,
                       psa_handle_t handle,
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.h b/secure_fw/spm/cmsis_psa/spm_ipc.h
index 9aa5a6e..a24f4ed 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.h
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.h
@@ -263,17 +263,6 @@
 struct tfm_msg_body_t *tfm_spm_get_msg_from_handle(psa_handle_t msg_handle);
 
 /**
- * \brief                   Get message context by connect handle.
- *
- * \param[in] conn_handle   Service connect handle.
- *
- * \return                  The message body context pointer
- *                          \ref msg_body_t structures
- */
-struct tfm_msg_body_t *
- tfm_spm_get_msg_buffer_from_conn_handle(struct tfm_conn_handle_t *conn_handle);
-
-/**
  * \brief                   Fill the message for PSA client call.
  *
  * \param[in] msg           Service Message Queue buffer pointer
diff --git a/secure_fw/spm/ffm/psa_api.c b/secure_fw/spm/ffm/psa_api.c
index ff2e3b0..ccc0838 100644
--- a/secure_fw/spm/ffm/psa_api.c
+++ b/secure_fw/spm/ffm/psa_api.c
@@ -313,11 +313,7 @@
         }
     }
 
-    /*
-     * FixMe: Need to check if the message is unrecognized by the RoT
-     * Service or incorrectly formatted.
-     */
-    msg = tfm_spm_get_msg_buffer_from_conn_handle(conn_handle);
+    msg = &(conn_handle->internal_msg);
 
     tfm_spm_fill_msg(msg, service, handle, type, client_id,
                      invecs, in_num, outvecs, out_num, outptr);
@@ -381,7 +377,7 @@
         return PSA_ERROR_CONNECTION_BUSY;
     }
 
-    msg = tfm_spm_get_msg_buffer_from_conn_handle(connect_handle);
+    msg = &(connect_handle->internal_msg);
 
     handle = tfm_spm_to_user_handle(connect_handle);
     /* No input or output needed for connect message */
@@ -426,7 +422,7 @@
         return PSA_ERROR_PROGRAMMER_ERROR;
     }
 
-    msg = tfm_spm_get_msg_buffer_from_conn_handle(conn_handle);
+    msg = &(conn_handle->internal_msg);
 
     /*
      * It is a PROGRAMMER ERROR if the connection is currently handling a