include/notifier: fix undefined reference to spin_lock_irqsave_nopreempt

Fix linker error caused by including spinlock_type.h instead of
spinlock.h in notifier.h header file.

Error message:
  undefined reference to 'spin_lock_irqsave_nopreempt'
  in .text.clock_changed_notifier_call_chain

Root cause:
The notifier.h header was including <nuttx/spinlock_type.h> which only
provides type definitions, but the inline functions in notifier.h use
spinlock functions like spin_lock_irqsave_nopreempt(). These functions
are defined in <nuttx/spinlock.h>, not in spinlock_type.h.

Solution:
Change the include from <nuttx/spinlock_type.h> to <nuttx/spinlock.h>
to get both the type definitions and the function implementations.

This fixes the undefined reference error when using notifier chains
with spinlock protection.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1
2025-08-04 20:15:46 +08:00
committed by GUIDINGLI
parent 1946bc4e44
commit afaaa7b8cb
+1 -1
View File
@@ -30,7 +30,7 @@
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include <nuttx/mutex.h>
#include <nuttx/spinlock_type.h>
#include <nuttx/spinlock.h>
#include <debug.h>
#include <errno.h>