return ret;
}
+static int tm1_set_pmqos_data_nop(char *res_name, void *data)
+{
+ /*
+ * The tm1_set_pmqos_data function is required to send the PMQoS
+ * scenario information to the socket interface of the TRM and it
+ * is optional, which means that this HAL for nonstandard should work
+ * without TRM. For this reason, if there is no unix domain socket file
+ * for the PMQoS scenario, this nop function is assigned to the
+ * set_pmqos_data pointer rather than returning error.
+ */
+ return 0;
+}
+
static int tm1_nonstandard_open(char *res_name, struct pass_resource_info *info,
struct pass_resource_common **common)
{
if (!nonstandard_res)
return -ENOMEM;
- ret = access(SCENARIO_INFO_SOCKET_PATH, F_OK);
- if (ret)
- return ret;
-
nonstandard_res->common.info = info;
- nonstandard_res->set_pmqos_data = tm1_set_pmqos_data;
+
+ ret = access(SCENARIO_INFO_SOCKET_PATH, F_OK);
+ if (!ret)
+ nonstandard_res->set_pmqos_data = tm1_set_pmqos_data;
+ else
+ nonstandard_res->set_pmqos_data = tm1_set_pmqos_data_nop;
*common = (struct pass_resource_common *) nonstandard_res;