Skip to content

Commit

Permalink
drivers/sensors/gnss: Fix deactivate failure when using both topic an…
Browse files Browse the repository at this point in the history
…d device

Deactivate lower driver fails when both uORB topic and driver device are subscribed and opened.

Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 authored and xiaoxiang781216 committed Dec 28, 2024
1 parent 73e55c9 commit b57006e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/sensors/gnss_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@ static int gnss_activate(FAR struct sensor_lowerhalf_s *lower,
if ((upper->crefs == 0 && enable) || (upper->crefs == 1 && !enable))
{
ret = upper->lower->ops->activate(upper->lower, filep, enable);
if (ret >= 0)
{
upper->crefs += enable ? 1 : -1;
}
}

if (ret >= 0)
{
upper->crefs += enable ? 1 : -1;
}

nxmutex_unlock(&upper->lock);
Expand Down

0 comments on commit b57006e

Please sign in to comment.