drivers: wdt: update to unified kernel

Use new semaphore APIs from unified kernel.

Change-Id: I1e051271212290a90a5659190bf031e9961e1917
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This commit is contained in:
Baohong Liu 2016-11-09 18:09:38 -08:00 committed by Anas Nashif
commit 3c01b5db57

View file

@ -16,6 +16,7 @@
#include <init.h> #include <init.h>
#include <device.h> #include <device.h>
#include <kernel.h>
#include <watchdog.h> #include <watchdog.h>
#include <ioapic.h> #include <ioapic.h>
#include <power.h> #include <power.h>
@ -27,7 +28,7 @@
struct wdt_data { struct wdt_data {
#ifdef CONFIG_WDT_QMSI_API_REENTRANCY #ifdef CONFIG_WDT_QMSI_API_REENTRANCY
struct nano_sem sem; struct k_sem sem;
#endif #endif
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT #ifdef CONFIG_DEVICE_POWER_MANAGEMENT
uint32_t device_power_state; uint32_t device_power_state;
@ -58,8 +59,8 @@ static void wdt_reentrancy_init(struct device *dev)
return; return;
} }
nano_sem_init(RP_GET(dev)); k_sem_init(RP_GET(dev), 0, UINT_MAX);
nano_sem_give(RP_GET(dev)); k_sem_give(RP_GET(dev));
} }
static void wdt_critical_region_start(struct device *dev) static void wdt_critical_region_start(struct device *dev)
@ -68,7 +69,7 @@ static void wdt_critical_region_start(struct device *dev)
return; return;
} }
nano_sem_take(RP_GET(dev), TICKS_UNLIMITED); k_sem_take(RP_GET(dev), K_FOREVER);
} }
static void wdt_critical_region_end(struct device *dev) static void wdt_critical_region_end(struct device *dev)
@ -77,7 +78,7 @@ static void wdt_critical_region_end(struct device *dev)
return; return;
} }
nano_sem_give(RP_GET(dev)); k_sem_give(RP_GET(dev));
} }
static void (*user_cb)(struct device *dev); static void (*user_cb)(struct device *dev);