drivers/pwm : remove critical section and mutex.

Use spinlock to replace critical section and mutex.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
This commit is contained in:
wangzhi16
2025-03-19 17:33:29 +08:00
committed by archer
parent 4a68e55277
commit 4fa66a6850
-6
View File
@@ -316,10 +316,6 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, unsigned int oflags)
if (!upper->started)
{
/* Disable interrupts to avoid race conditions */
flags = enter_critical_section();
/* Indicate that if will be waiting for the pulse count to complete.
* Note that we will only wait if a non-zero pulse count is specified
* and if the PWM driver was opened in normal, blocking mode. Also
@@ -369,8 +365,6 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, unsigned int oflags)
upper->started = false;
upper->waiting = false;
}
leave_critical_section(flags);
}
return ret;