Factor out prepare_workload() for the following re-factor.
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
return ret;
}
+static int prepare_workload(struct intel_vgpu_workload *workload)
+{
+ int ret = 0;
+
+ if (workload->prepare)
+ ret = workload->prepare(workload);
+
+ return ret;
+}
+
static int dispatch_workload(struct intel_vgpu_workload *workload)
{
struct intel_vgpu *vgpu = workload->vgpu;
if (ret)
goto out;
- if (workload->prepare) {
- ret = workload->prepare(workload);
- if (ret) {
- engine->context_unpin(engine, shadow_ctx);
- goto out;
- }
+ ret = prepare_workload(workload);
+ if (ret) {
+ engine->context_unpin(engine, shadow_ctx);
+ goto out;
}
out: