aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
index 62c1e27..5a07baa 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
@@ -123,12 +123,12 @@ static int HalCtlsInitOneApi(AFB_ApiT apiHandle)
// TBD JAI: handle refresh of hal status for dynamic card (/dev/by-id)
- return 0;
+ return CtlConfigExec(apiHandle, ctrlConfig);
}
static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle)
{
- int err = 0;
+ int err;
CtlConfigT *ctrlConfig;
if(! cbdata || ! apiHandle )
@@ -146,17 +146,13 @@ static int HalCtlsLoadOneApi(void *cbdata, AFB_ApiT apiHandle)
}
// Load section for corresponding Api
- err += CtlLoadSections(apiHandle, ctrlConfig, ctrlSections);
+ err = CtlLoadSections(apiHandle, ctrlConfig, ctrlSections);
// Declare an event manager for this Api
afb_dynapi_on_event(apiHandle, HalCtlsDispatchApiEvent);
// Init Api function (does not receive user closure ???)
- afb_dynapi_on_init(apiHandle, NULL);
-
- err += HalCtlsInitOneApi(apiHandle);
-
- err += CtlConfigExec(apiHandle, ctrlConfig);
+ afb_dynapi_on_init(apiHandle, HalCtlsInitOneApi);
return err;
}