diff --git a/framework/include/fwk_module.h b/framework/include/fwk_module.h index 6934c465974955699ad6b92978ab3b2994100f24..b207191ec4622a234e23c5147177f278064b3fe8 100644 --- a/framework/include/fwk_module.h +++ b/framework/include/fwk_module.h @@ -423,8 +423,9 @@ const void *fwk_module_get_data(fwk_id_t id); * * \retval FWK_SUCCESS The module or element can service API calls. * \retval FWK_E_PARAM The identifier is invalid. - * \retval FWK_E_STATE The module or the element is not initialized or - * suspended. + * \retval FWK_E_INIT The module or element is not initialized. + * \retval FWK_E_STATE The module or element is suspended. + * */ int fwk_module_check_call(fwk_id_t id); diff --git a/framework/src/fwk_module.c b/framework/src/fwk_module.c index 1b3a6b411307bd4101434f05558080a92bc0106d..cfff4ceb24ae7a63dd40dae7a261bd3fed1078c9 100644 --- a/framework/src/fwk_module.c +++ b/framework/src/fwk_module.c @@ -613,8 +613,12 @@ int fwk_module_check_call(fwk_id_t id) if (status != FWK_SUCCESS) goto error; - if ((state == FWK_MODULE_STATE_UNINITIALIZED) || - (state == FWK_MODULE_STATE_SUSPENDED)) { + if (state == FWK_MODULE_STATE_UNINITIALIZED) { + status = FWK_E_INIT; + goto error; + } + + if (state == FWK_MODULE_STATE_SUSPENDED) { status = FWK_E_STATE; goto error; } diff --git a/framework/test/test_fwk_module.c b/framework/test/test_fwk_module.c index 2e5f679346eb23ec1d1af5ecfd93a279cd9b34bc..b31f729843158252ee1847f7cba18ef1e726278e 100644 --- a/framework/test/test_fwk_module.c +++ b/framework/test/test_fwk_module.c @@ -367,10 +367,10 @@ static void test_fwk_module_check_call_failed(void) result = fwk_module_check_call(id); assert(result == FWK_E_PARAM); - /* Module 0 state is not FWK_MODULE_STATE_INITIALIZED */ + /* Module 0 is not initialized */ id = MODULE0_ID; result = fwk_module_check_call(id); - assert(result == FWK_E_STATE); + assert(result == FWK_E_INIT); } static void test___fwk_module_init_module_desc_bad_params(void) diff --git a/module/power_domain/include/mod_power_domain.h b/module/power_domain/include/mod_power_domain.h index ed204f83e3965326924dc789d51dbab2d7ebd4bb..e4123d728daaf561cc89363a7b160938baface3c 100644 --- a/module/power_domain/include/mod_power_domain.h +++ b/module/power_domain/include/mod_power_domain.h @@ -480,7 +480,8 @@ struct mod_pd_public_api { * \param type Pointer to storage for the type of the power domain. * * \retval FWK_SUCCESS The type of the power domain was returned. - * \retval FWK_E_STATE The module has not been initialized. + * \retval FWK_E_INIT The module has not been initialized. + * \retval FWK_E_STATE The power domain module is in an invalid state. * \retval FWK_E_PARAM The power domain identifier is unknown. * \retval FWK_E_PARAM The pointer 'type' is equal to NULL. */ @@ -498,7 +499,8 @@ struct mod_pd_public_api { * * \retval FWK_SUCCESS The identifier of the parent power domain was * returned. - * \retval FWK_E_STATE The component has not been initialized. + * \retval FWK_E_INIT The module has not been initialized. + * \retval FWK_E_STATE The power domain module is in an invalid state. * \retval FWK_E_PARAM The power domain identifier is unknown. * \retval FWK_E_PARAM The pointer 'parent_pd_id' is equal to NULL. */ @@ -522,7 +524,8 @@ struct mod_pd_restricted_api { * \param type Pointer to storage for the type of the power domain. * * \retval FWK_SUCCESS The type of the power domain was returned. - * \retval FWK_E_STATE The module has not been initialized. + * \retval FWK_E_INIT The module has not been initialized. + * \retval FWK_E_STATE The power domain module is in an invalid state. * \retval FWK_E_PARAM The power domain identifier is unknown. * \retval FWK_E_PARAM The pointer 'type' is equal to NULL. */ @@ -540,7 +543,8 @@ struct mod_pd_restricted_api { * * \retval FWK_SUCCESS The identifier of the parent power domain was * returned. - * \retval FWK_E_STATE The component has not been initialized. + * \retval FWK_E_INIT The module has not been initialized. + * \retval FWK_E_STATE The power domain module is in an invalid state. * \retval FWK_E_PARAM The power domain identifier is unknown. * \retval FWK_E_PARAM The pointer 'parent_pd_id' is equal to NULL. */ diff --git a/module/scmi/include/mod_scmi.h b/module/scmi/include/mod_scmi.h index b846064b067ae0f1cba483d709c73a63eaa2d352..852d0438f18e293663baa5b4d2407200e735538d 100644 --- a/module/scmi/include/mod_scmi.h +++ b/module/scmi/include/mod_scmi.h @@ -315,7 +315,8 @@ struct mod_scmi_from_protocol_api { * \retval FWK_SUCCESS The agent identifier was returned. * \retval FWK_E_PARAM The service identifier is not valid. * \retval FWK_E_PARAM The parameter 'agent_id' is equal to NULL. - * \retval FWK_E_STATE The service is not initialized. + * \retval FWK_E_INIT The service is not initialized. + * \retval FWK_E_STATE The service is in an invalid state. */ int (*get_agent_id)(fwk_id_t service_id, unsigned int *agent_id); @@ -331,7 +332,6 @@ struct mod_scmi_from_protocol_api { * \retval FWK_SUCCESS The agent identifier was returned. * \retval FWK_E_PARAM The agent identifier is not valid. * \retval FWK_E_PARAM The parameter 'agent_type' is equal to NULL. - * \retval FWK_E_STATE The component is not initialized. */ int (*get_agent_type)(uint32_t agent_id, enum scmi_agent_type *agent_type); @@ -346,7 +346,8 @@ struct mod_scmi_from_protocol_api { * \retval FWK_SUCCESS The operation succeeded. * \retval FWK_E_PARAM The service_id parameter is invalid. * \retval FWK_E_PARAM The size parameter is NULL. - * \retval FWK_E_STATE The service is not initialized. + * \retval FWK_E_INIT The service is not initialized. + * \retval FWK_E_STATE The service is in an invalid sate. * \return One of the standard error codes for implementation-defined * errors. */