diff --git a/arch/sim/src/up_oneshot.c b/arch/sim/src/up_oneshot.c index 8f4a368333e..cef9c9b2ea4 100644 --- a/arch/sim/src/up_oneshot.c +++ b/arch/sim/src/up_oneshot.c @@ -77,7 +77,7 @@ struct sim_oneshot_lowerhalf_s * Private Function Prototypes ****************************************************************************/ -static void sim_oneshot_handler(void *arg); +static void sim_oneshot_handler(int argc, wdparm_t arg1, ...); static int sim_max_delay(FAR struct oneshot_lowerhalf_s *lower, FAR struct timespec *ts); @@ -119,14 +119,14 @@ static const struct oneshot_operations_s g_oneshot_ops = * ****************************************************************************/ -static void sim_oneshot_handler(void *arg) +static void sim_oneshot_handler(int argc, wdparm_t arg1, ...) { FAR struct sim_oneshot_lowerhalf_s *priv = - (FAR struct sim_oneshot_lowerhalf_s *)arg; + (FAR struct sim_oneshot_lowerhalf_s *)arg1; oneshot_callback_t callback; FAR void *cbarg; - DEBUGASSERT(priv != NULL); + DEBUGASSERT(argc == 1 && priv != NULL); /* Perhaps the callback was nullified in a race condition with * sim_cancel? diff --git a/drivers/timers/oneshot.c b/drivers/timers/oneshot.c index 975f83bba2b..518071d19db 100644 --- a/drivers/timers/oneshot.c +++ b/drivers/timers/oneshot.c @@ -239,9 +239,8 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg) return ret; } - /* Handle built-in ioctl commands */ + /* Handle oneshot timer ioctl commands */ - ret = -EINVAL; switch (cmd) { /* OSIOC_MAXDELAY - Return the maximum delay that can be supported @@ -286,7 +285,7 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg) /* Start the oneshot timer */ - ret = ONESHOT_START(priv->od_lower, oneshot_callback, start->arg, + ret = ONESHOT_START(priv->od_lower, oneshot_callback, priv, &start->ts); } break;