sja1000: replace enter_critical_section with spinlock

Replace enter_critical_section() with spinlock-based protection to
avoid sleeping in atomic or interrupt contexts.

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
This commit is contained in:
xucheng5
2025-06-30 21:02:15 +08:00
committed by Alan C. Assis
parent f215bf6c67
commit 380bcabba8
2 changed files with 11 additions and 67 deletions
+1 -4
View File
@@ -112,10 +112,7 @@ struct sja1000_dev_s
uint8_t filters; /* STD/EXT filter bit allocator. */
uint8_t nalloc; /* Number of allocated filters */
uint32_t base; /* SJA1000 register base address */
#ifdef CONFIG_ARCH_HAVE_MULTICPU
spinlock_t lock; /* Device specific lock */
#endif /* CONFIG_ARCH_HAVE_MULTICPU */
spinlock_t lock; /* Device specific lock */
/* Register read/write callbacks. These operations all hidden behind
* callbacks to isolate the driver from differences in register read/write