mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-26 22:32:22 +01:00
Tegra vendor kernels (L4T / NVIDIA Yocto BSP) fail to compile the
wolfSSL Linux kernel module due to the use of the legacy assignment form
of the spinlock initializer:
m->lock = __SPIN_LOCK_UNLOCKED(m);
On Tegra, __SPIN_LOCK_UNLOCKED() expands to a braced-struct initializer
that is *not* valid as an assignment expression, causing:
error: expected expression before '{' token
This patch applies a Tegra-specific workaround by replacing the
assignment with the stable kernel API:
spin_lock_init(&m->lock);
This is guarded behind CONFIG_ARCH_TEGRA so that non-Tegra platforms
retain the current initialization behavior until further validation is
completed.
This fix restores successful kernel module builds on NVIDIA Tegra-based
Yocto images without modifying behavior on other architectures.
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>