firmware: scmi: core: don't allow mutex usage in PRE_KERNEL stage

While in PRE_KERNEL stage, scmi_send_message_polling() attempts to acquire
the transmit channel mutex, which should not be allowed as the kernel is
not fully initialized at this point.

Since there's no multithreading at this point, there's no need to use a
mutex anyways. Therefore, perform mutex acquire()/release() only if not
in PRE_KERNEL phase.

Note that the return value of k_mutex_lock() is already suppressed via
an -EBUSY return value so no behavioral change here.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
1 file changed