]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_ffa: Move the function ffa_features() earlier
authorSudeep Holla <sudeep.holla@arm.com>
Tue, 20 Aug 2024 14:27:56 +0000 (15:27 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 20 Aug 2024 14:40:44 +0000 (15:40 +0100)
We need to use ffa_features() in ffa_partition_probe() to detect if
the newer FFA_PARTITION_INFO_GET_REGS API is supported in the platform
or not. To avoid unnecessary forward declaration within the file, let
us just move this ffa_features() earlier.

No funtional change.

Message-Id: <20240820-ffa_v1-2-v2-3-18c0c5f3c65e@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_ffa/driver.c

index be77e03578cc93e7350db1c7af1326b8b395cc41..91681933ece9c3d84f7e37a6eb94080665dd988b 100644 (file)
@@ -212,6 +212,32 @@ static int ffa_rxtx_unmap(u16 vm_id)
        return 0;
 }
 
+static int ffa_features(u32 func_feat_id, u32 input_props,
+                       u32 *if_props_1, u32 *if_props_2)
+{
+       ffa_value_t id;
+
+       if (!ARM_SMCCC_IS_FAST_CALL(func_feat_id) && input_props) {
+               pr_err("%s: Invalid Parameters: %x, %x", __func__,
+                      func_feat_id, input_props);
+               return ffa_to_linux_errno(FFA_RET_INVALID_PARAMETERS);
+       }
+
+       invoke_ffa_fn((ffa_value_t){
+               .a0 = FFA_FEATURES, .a1 = func_feat_id, .a2 = input_props,
+               }, &id);
+
+       if (id.a0 == FFA_ERROR)
+               return ffa_to_linux_errno((int)id.a2);
+
+       if (if_props_1)
+               *if_props_1 = id.a2;
+       if (if_props_2)
+               *if_props_2 = id.a3;
+
+       return 0;
+}
+
 #define PARTITION_INFO_GET_RETURN_COUNT_ONLY   BIT(0)
 
 /* buffer must be sizeof(struct ffa_partition_info) * num_partitions */
@@ -598,32 +624,6 @@ static int ffa_memory_reclaim(u64 g_handle, u32 flags)
        return 0;
 }
 
-static int ffa_features(u32 func_feat_id, u32 input_props,
-                       u32 *if_props_1, u32 *if_props_2)
-{
-       ffa_value_t id;
-
-       if (!ARM_SMCCC_IS_FAST_CALL(func_feat_id) && input_props) {
-               pr_err("%s: Invalid Parameters: %x, %x", __func__,
-                      func_feat_id, input_props);
-               return ffa_to_linux_errno(FFA_RET_INVALID_PARAMETERS);
-       }
-
-       invoke_ffa_fn((ffa_value_t){
-               .a0 = FFA_FEATURES, .a1 = func_feat_id, .a2 = input_props,
-               }, &id);
-
-       if (id.a0 == FFA_ERROR)
-               return ffa_to_linux_errno((int)id.a2);
-
-       if (if_props_1)
-               *if_props_1 = id.a2;
-       if (if_props_2)
-               *if_props_2 = id.a3;
-
-       return 0;
-}
-
 static int ffa_notification_bitmap_create(void)
 {
        ffa_value_t ret;