From 891273dd1a3fdadd27c5789b9b305cc21c0faf9f Mon Sep 17 00:00:00 2001 From: Baohong Liu Date: Mon, 5 Dec 2016 14:44:45 -0800 Subject: [PATCH] device: add deprecated attribute to device sync APIs Device_sync_call related APIs and typedef are actually wrappers for kernel semaphores. These APIs and typedef will be deprecated. Let's add deprecated attribute to give deprecation warning. Jira: ZEP-1411 Change-Id: Ia07557cc81bd9ee8e41f2e17be4607c4bd6d23bd Signed-off-by: baohong Liu --- include/device.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/device.h b/include/device.h index 6f1a34f563c..7bf99815d56 100644 --- a/include/device.h +++ b/include/device.h @@ -639,7 +639,7 @@ int device_busy_check(struct device *chk_dev); typedef struct { /** Nanokernel semaphore used for fiber context */ struct k_sem f_sem; -} device_sync_call_t; +} __deprecated device_sync_call_t; /** @@ -647,7 +647,7 @@ typedef struct { * * @param sync A pointer to a valid device_sync_call_t */ -static inline void device_sync_call_init(device_sync_call_t *sync) +static inline void __deprecated device_sync_call_init(device_sync_call_t *sync) { k_sem_init(&sync->f_sem, 0, UINT_MAX); } @@ -658,7 +658,7 @@ static inline void device_sync_call_init(device_sync_call_t *sync) * * @param sync A pointer to a valid device_sync_call_t */ -static inline void device_sync_call_wait(device_sync_call_t *sync) +static inline void __deprecated device_sync_call_wait(device_sync_call_t *sync) { k_sem_take(&sync->f_sem, K_FOREVER); } @@ -669,7 +669,8 @@ static inline void device_sync_call_wait(device_sync_call_t *sync) * * @param sync A pointer to a valid device_sync_call_t */ -static inline void device_sync_call_complete(device_sync_call_t *sync) +static inline void __deprecated + device_sync_call_complete(device_sync_call_t *sync) { k_sem_give(&sync->f_sem); }