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 <wangchengdong@lixiang.com>
This commit is contained in:
wangchengdong
2026-01-19 09:36:10 +08:00
committed by Xiang Xiao
parent a7daf0a04d
commit 7aa761c69d
3 changed files with 22 additions and 1 deletions
+10
View File
@@ -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);
+4
View File
@@ -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;
+8 -1
View File
@@ -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);