This is an automated email from the ASF dual-hosted git repository.

jiuzhudong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a8214b0b1eb75ce3f13cbb1c3f86d4f0ba514c10
Author: fangpeina <[email protected]>
AuthorDate: Fri Jun 13 20:08:05 2025 +0800

    drivers/input/ff: use small lock to replace enter_critical_section
    
    replace critical_section with spinlock
    
    Signed-off-by: fangpeina <[email protected]>
---
 drivers/input/ff_upper.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/input/ff_upper.c b/drivers/input/ff_upper.c
index 7775405744e..4c24ab62efa 100644
--- a/drivers/input/ff_upper.c
+++ b/drivers/input/ff_upper.c
@@ -204,7 +204,6 @@ static int ff_erase_effect(FAR struct ff_upperhalf_s 
*upper, int effect_id,
                            FAR struct file *filep)
 {
   FAR struct ff_lowerhalf_s *lower = upper->lower;
-  irqstate_t flags;
   int ret;
 
   ret = ff_check_effect_access(upper, effect_id, filep);
@@ -213,9 +212,7 @@ static int ff_erase_effect(FAR struct ff_upperhalf_s 
*upper, int effect_id,
       return ret;
     }
 
-  flags = enter_critical_section();
   lower->playback(lower, effect_id, 0);
-  leave_critical_section(flags);
 
   upper->effects[effect_id].owner = NULL;
   if (lower->erase != NULL)
@@ -465,7 +462,6 @@ static int ff_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
 
 int ff_event(FAR struct ff_lowerhalf_s *lower, uint32_t code, int value)
 {
-  irqstate_t flags;
   int ret = OK;
 
   switch (code)
@@ -477,9 +473,7 @@ int ff_event(FAR struct ff_lowerhalf_s *lower, uint32_t 
code, int value)
               break;
             }
 
-          flags = enter_critical_section();
           lower->set_gain(lower, value);
-          leave_critical_section(flags);
         }
         break;
 
@@ -490,9 +484,7 @@ int ff_event(FAR struct ff_lowerhalf_s *lower, uint32_t 
code, int value)
               break;
             }
 
-          flags = enter_critical_section();
           lower->set_autocenter(lower, value);
-          leave_critical_section(flags);
         }
         break;
 
@@ -500,9 +492,7 @@ int ff_event(FAR struct ff_lowerhalf_s *lower, uint32_t 
code, int value)
         {
           if (ff_check_effect_access(lower->priv, code, NULL) == 0)
             {
-              flags = enter_critical_section();
               ret = lower->playback(lower, code, value);
-              leave_critical_section(flags);
             }
         }
         break;

Reply via email to