summaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-08 10:34:32 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commitbb223de50300ff4fcf2e7063bdf5e64334cf26fb (patch)
treead234e38c7a73f380c838402ad4adc339e8b9c53 /4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
parentb04d49861f2f2960c467e85d0719e1b4857b6722 (diff)
Change the way to get card id using its path
Change the way to get card id using its path by returning directly the found card id. Corrects a typo in alsa core link header. Change-Id: Ib202632e049921a57428b31a29f7def4d9e78aaa Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c8
1 files changed, 5 insertions, 3 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 e634521..e11f989 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
@@ -105,10 +105,12 @@ static int HalCtlsInitOneApi(AFB_ApiT apiHandle)
currentCtlHalData->ctlHalSpecificData->ctlHalStreamsData.count = 0;
- if(HalCtlsGetCardIdByCardPath(apiHandle, currentCtlHalData))
- currentCtlHalData->status = HAL_STATUS_AVAILABLE;
- else
+ currentCtlHalData->sndCardId = HalCtlsGetCardIdByCardPath(apiHandle, currentCtlHalData->sndCard);
+
+ if(currentCtlHalData->sndCardId < 0)
currentCtlHalData->status = HAL_STATUS_UNAVAILABLE;
+ else
+ currentCtlHalData->status = HAL_STATUS_AVAILABLE;
// TBD JAI: handle refresh of hal status for dynamic card (/dev/by-id)