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

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

commit 7aa761c69dd678fd4e2fbfc0f4a7ac126f389933
Author: wangchengdong <[email protected]>
AuthorDate: Mon Jan 19 09:36:10 2026 +0800

    drivers/input: remove nxsig_notification when signal support is disabled
    
    When all signals are disabled, nxsig_notification is not available and
    should not be invoked. Remove the call to avoid build and runtime issues
    in no-signal configurations.
    
    Signed-off-by: Chengdong Wang <[email protected]>
---
 drivers/input/ajoystick.c    | 10 ++++++++++
 drivers/input/button_upper.c |  4 ++++
 drivers/input/djoystick.c    |  9 ++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/input/ajoystick.c b/drivers/input/ajoystick.c
index ce8fea13007..4f37e89e280 100644
--- a/drivers/input/ajoystick.c
+++ b/drivers/input/ajoystick.c
@@ -84,9 +84,11 @@ struct ajoy_open_s
 
   /* Joystick event notification information */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
   pid_t ao_pid;
   struct ajoy_notify_s ao_notify;
   struct sigwork_s ao_work;
+#endif
 
   /* Poll event information */
 
@@ -173,8 +175,10 @@ static void ajoy_enable(FAR struct ajoy_upperhalf_s *priv)
 
       /* OR in the signal events */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
       press   |= opriv->ao_notify.an_press;
       release |= opriv->ao_notify.an_release;
+#endif
     }
 
   /* Enable/disable button interrupts */
@@ -271,6 +275,7 @@ static void ajoy_sample(FAR struct ajoy_upperhalf_s *priv)
 
       /* Have any signal events occurred? */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
       if ((press & opriv->ao_notify.an_press)     != 0 ||
           (release & opriv->ao_notify.an_release) != 0)
         {
@@ -280,6 +285,7 @@ static void ajoy_sample(FAR struct ajoy_upperhalf_s *priv)
           nxsig_notification(opriv->ao_pid, &opriv->ao_notify.an_event,
                              SI_QUEUE, &opriv->ao_work);
         }
+#endif
     }
 
   priv->au_sample = sample;
@@ -394,7 +400,9 @@ static int ajoy_close(FAR struct file *filep)
 
   /* Cancel any pending notification */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
   nxsig_cancel_notification(&opriv->ao_work);
+#endif
 
   /* And free the open structure */
 
@@ -545,6 +553,7 @@ static int ajoy_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
      *              failure with the errno value set appropriately.
      */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
     case AJOYIOC_REGISTER:
       {
         FAR struct ajoy_notify_s *notify =
@@ -566,6 +575,7 @@ static int ajoy_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
           }
       }
       break;
+#endif
 
     default:
       ierr("ERROR: Unrecognized command: %ld\n", cmd);
diff --git a/drivers/input/button_upper.c b/drivers/input/button_upper.c
index 6a871ff2c7b..133758eb99e 100644
--- a/drivers/input/button_upper.c
+++ b/drivers/input/button_upper.c
@@ -85,9 +85,11 @@ struct btn_open_s
 
   /* Button event notification information */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
   pid_t bo_pid;
   struct btn_notify_s bo_notify;
   struct sigwork_s bo_work;
+#endif
 
   /* Poll event information */
 
@@ -297,6 +299,7 @@ static void btn_sample(wdparm_t arg)
 
       /* Have any signal events occurred? */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
       if ((press & opriv->bo_notify.bn_press)     != 0 ||
           (release & opriv->bo_notify.bn_release) != 0)
         {
@@ -306,6 +309,7 @@ static void btn_sample(wdparm_t arg)
           nxsig_notification(opriv->bo_pid, &opriv->bo_notify.bn_event,
                              SI_QUEUE, &opriv->bo_work);
         }
+#endif
     }
 
   priv->bu_sample = sample;
diff --git a/drivers/input/djoystick.c b/drivers/input/djoystick.c
index 1db52b2022b..7b8d6781406 100644
--- a/drivers/input/djoystick.c
+++ b/drivers/input/djoystick.c
@@ -84,9 +84,11 @@ struct djoy_open_s
 
   /* Joystick event notification information */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
   pid_t do_pid;
   struct djoy_notify_s do_notify;
   struct sigwork_s do_work;
+#endif
 
   /* Poll event information */
 
@@ -172,9 +174,10 @@ static void djoy_enable(FAR struct djoy_upperhalf_s *priv)
       release |= opriv->do_pollevents.dp_release;
 
       /* OR in the signal events */
-
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
       press   |= opriv->do_notify.dn_press;
       release |= opriv->do_notify.dn_release;
+#endif
     }
 
   /* Enable/disable button interrupts */
@@ -271,6 +274,7 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv)
 
       /* Have any signal events occurred? */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
       if ((press & opriv->do_notify.dn_press)     != 0 ||
           (release & opriv->do_notify.dn_release) != 0)
         {
@@ -280,6 +284,7 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv)
           nxsig_notification(opriv->do_pid, &opriv->do_notify.dn_event,
                              SI_QUEUE, &opriv->do_work);
         }
+#endif
     }
 
   priv->du_sample = sample;
@@ -541,6 +546,7 @@ static int djoy_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
      *              failure with the errno value set appropriately.
      */
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
     case DJOYIOC_REGISTER:
       {
         FAR struct djoy_notify_s *notify =
@@ -562,6 +568,7 @@ static int djoy_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
           }
       }
       break;
+#endif
 
     default:
       ierr("ERROR: Unrecognized command: %d\n", cmd);

Reply via email to