SPM: Remove unused code in no connection based service

In no connection based service case:

- tfm_spm_validate_conn_handle API is not used in no connection
  based service case.
- Return error directly if handle is not static

Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: I1783fc9f5bf37944e591389730ae2d3e08b8ed74
diff --git a/secure_fw/spm/ffm/psa_api.c b/secure_fw/spm/ffm/psa_api.c
index 62715db..810f9bd 100644
--- a/secure_fw/spm/ffm/psa_api.c
+++ b/secure_fw/spm/ffm/psa_api.c
@@ -214,6 +214,7 @@
         conn_handle->rhandle = NULL;
         handle = tfm_spm_to_user_handle(conn_handle);
     } else {
+#if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1
         conn_handle = tfm_spm_to_handle_instance(handle);
 
         /* It is a PROGRAMMER ERROR if an invalid handle was passed. */
@@ -244,6 +245,9 @@
             /* FixMe: Need to implement a mechanism to resolve this failure. */
             return PSA_ERROR_PROGRAMMER_ERROR;
         }
+#else
+        return PSA_ERROR_PROGRAMMER_ERROR;
+#endif
     }
 
     privileged = GET_CURRENT_PARTITION_PRIVILEGED_MODE();