SST: Update connection handle check

Replace TFM_PSA_HANDLE_IS_VALID with PSA_HANDLE_IS_VALID which is
defined in PSA FF for checking the validity of connection.

Change-Id: Ib95b60dfe8f644fc7164cd51cb02897b5691ea15
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index c7796d0..c3a1504 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -14,8 +14,6 @@
 #endif
 
 #define IOVEC_LEN(x) (uint32_t)(sizeof(x)/sizeof(x[0]))
-/* FixMe: Check if PSA framework header would provide similar macro. */
-#define TFM_PSA_HANDLE_IS_VALID(handle)  ((handle) > (psa_handle_t)0)
 
 psa_ps_status_t psa_ps_set(psa_ps_uid_t uid,
                            uint32_t data_length,
@@ -40,7 +38,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_SET_SID, TFM_SST_SET_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -88,7 +86,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_SID, TFM_SST_GET_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -133,7 +131,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_INFO_SID, TFM_SST_GET_INFO_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -177,7 +175,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_REMOVE_SID, TFM_SST_REMOVE_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -243,7 +241,7 @@
      */
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_SUPPORT_SID, TFM_SST_GET_SUPPORT_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return support_flags;
     }
 
diff --git a/secure_fw/services/secure_storage/tfm_sst_secure_api.c b/secure_fw/services/secure_storage/tfm_sst_secure_api.c
index f7832ad..781e84b 100644
--- a/secure_fw/services/secure_storage/tfm_sst_secure_api.c
+++ b/secure_fw/services/secure_storage/tfm_sst_secure_api.c
@@ -12,8 +12,6 @@
 #endif
 
 #define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
-/* FixMe: Check if PSA framework header would provide similar macro. */
-#define TFM_PSA_HANDLE_IS_VALID(handle)  ((handle) > (psa_handle_t)0)
 
 __attribute__((section("SFN")))
 psa_ps_status_t psa_ps_set(psa_ps_uid_t uid,
@@ -39,7 +37,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_SET_SID, TFM_SST_SET_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -86,7 +84,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_SID, TFM_SST_GET_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -129,7 +127,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_INFO_SID, TFM_SST_GET_INFO_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -172,7 +170,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_REMOVE_SID, TFM_SST_REMOVE_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return PSA_PS_ERROR_OPERATION_FAILED;
     }
 
@@ -239,7 +237,7 @@
      */
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_SST_GET_SUPPORT_SID, TFM_SST_GET_SUPPORT_VERSION);
-    if (!TFM_PSA_HANDLE_IS_VALID(handle)) {
+    if (!PSA_HANDLE_IS_VALID(handle)) {
         return support_flags;
     }