SPM: Remove the tfm_spm_get_running_partition()

This API simply returns GET_CURRENT_COMPONENT().
Not necessary to keep it as a function.

This patch removes it and replace with GET_CURRENT_COMPONENT().
This patch also removes the tfm_spm_get_caller_privilege_mode().

Change-Id: Iec90800b43838205b42fecf14775d16cad9f3b26
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/ffm/psa_api.c b/secure_fw/spm/ffm/psa_api.c
index 28da0c5..ff2e3b0 100644
--- a/secure_fw/spm/ffm/psa_api.c
+++ b/secure_fw/spm/ffm/psa_api.c
@@ -246,7 +246,7 @@
         }
     }
 
-    privileged = tfm_spm_get_caller_privilege_mode();
+    privileged = GET_CURRENT_PARTITION_PRIVILEGED_MODE();
 
     /*
      * Read client invecs from the wrap input vector. It is a PROGRAMMER ERROR
@@ -458,10 +458,7 @@
      */
     timeout &= PSA_TIMEOUT_MASK;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     /*
      * It is a PROGRAMMER ERROR if the signal_mask does not include any assigned
@@ -500,10 +497,8 @@
         tfm_core_panic();
     }
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
+
     privileged = GET_PARTITION_PRIVILEGED_MODE(partition->p_ldinf);
 
     /*
@@ -884,10 +879,7 @@
     struct critical_section_t cs_assert = CRITICAL_SECTION_STATIC_INIT;
     struct partition_t *partition = NULL;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     /*
      * It is a fatal error if the Secure Partition's doorbell signal is not
@@ -908,10 +900,7 @@
     struct irq_load_info_t *irq_info = NULL;
     struct partition_t *partition = NULL;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     irq_info = get_irq_info_for_signal(partition->p_ldinf, irq_signal);
     /* It is a fatal error if passed signal is not an interrupt signal. */
@@ -951,10 +940,7 @@
     struct partition_t *partition;
     struct irq_load_info_t *irq_info;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     irq_info = get_irq_info_for_signal(partition->p_ldinf, irq_signal);
     if (!irq_info) {
@@ -969,10 +955,7 @@
     struct partition_t *partition;
     struct irq_load_info_t *irq_info;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     irq_info = get_irq_info_for_signal(partition->p_ldinf, irq_signal);
     if (!irq_info) {
@@ -990,10 +973,7 @@
     struct irq_load_info_t *irq_info;
     struct partition_t *partition;
 
-    partition = tfm_spm_get_running_partition();
-    if (!partition) {
-        tfm_core_panic();
-    }
+    partition = GET_CURRENT_COMPONENT();
 
     irq_info = get_irq_info_for_signal(partition->p_ldinf, irq_signal);
     if (!irq_info) {