From 12af9343531312255ace5c15a53b32283ad16558 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 8 Nov 2016 16:39:39 -0800 Subject: [PATCH] device.h: use new semaphore APIs Change-Id: I87c84cbdaaf25bc1503ed8a12b595b13f9089740 Signed-off-by: Andrew Boie --- include/device.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/device.h b/include/device.h index 26ad0ba1e99..ab013dcf4d0 100644 --- a/include/device.h +++ b/include/device.h @@ -619,7 +619,7 @@ int device_busy_check(struct device *chk_dev); */ typedef struct { /** Nanokernel semaphore used for fiber context */ - struct nano_sem f_sem; + struct k_sem f_sem; } device_sync_call_t; @@ -630,7 +630,7 @@ typedef struct { */ static inline void device_sync_call_init(device_sync_call_t *sync) { - nano_sem_init(&sync->f_sem); + k_sem_init(&sync->f_sem, 0, UINT_MAX); } /** @@ -641,7 +641,7 @@ static inline void device_sync_call_init(device_sync_call_t *sync) */ static inline void device_sync_call_wait(device_sync_call_t *sync) { - nano_sem_take(&sync->f_sem, TICKS_UNLIMITED); + k_sem_take(&sync->f_sem, K_FOREVER); } /** @@ -652,7 +652,7 @@ static inline void device_sync_call_wait(device_sync_call_t *sync) */ static inline void device_sync_call_complete(device_sync_call_t *sync) { - nano_sem_give(&sync->f_sem); + k_sem_give(&sync->f_sem); } #ifdef __cplusplus