soc: nordic: nrf54h: gpd: fix compile warning when CONFIG_DEBUG=y
Usage of K_SPINLOCK with CONFIG_DEBUG=y seems to trigger a compiler warning about request not always being initialized. Fallback to k_spin_lock/unlock calls to fix this issue. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
4bb945300b
commit
5249619f6a
1 changed files with 9 additions and 6 deletions
|
@ -66,15 +66,18 @@ static int nrf_gpd_sync(struct gpd_onoff_manager *gpd_mgr)
|
|||
{
|
||||
int64_t start;
|
||||
nrfs_err_t err;
|
||||
k_spinlock_key_t key;
|
||||
gdpwr_request_type_t request;
|
||||
|
||||
K_SPINLOCK(&gpd_mgr->mgr.lock) {
|
||||
key = k_spin_lock(&gpd_mgr->mgr.lock);
|
||||
|
||||
if (gpd_mgr->mgr.refs == 0) {
|
||||
request = GDPWR_POWER_REQUEST_CLEAR;
|
||||
} else {
|
||||
request = GDPWR_POWER_REQUEST_SET;
|
||||
}
|
||||
}
|
||||
|
||||
k_spin_unlock(&gpd_mgr->mgr.lock, key);
|
||||
|
||||
atomic_clear_bit(&gpd_service_status, GPD_SERVICE_REQ_ERR);
|
||||
atomic_clear_bit(&gpd_service_status, GPD_SERVICE_REQ_OK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue