arch: Replace critical section with nxmutex in i2c/spi/1wire initialization

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
anjiahao
2022-09-06 14:18:45 +08:00
committed by Masayuki Ishikawa
parent d1d46335df
commit dee38ce3e8
47 changed files with 347 additions and 537 deletions
+4 -4
View File
@@ -301,7 +301,7 @@ static int nunchuck_open(FAR struct file *filep)
{
ierr("ERROR: Failed to allocate open structure\n");
ret = -ENOMEM;
goto errout_with_excllock;
goto errout_with_lock;
}
/* Attach the open structure to the device */
@@ -314,7 +314,7 @@ static int nunchuck_open(FAR struct file *filep)
filep->f_priv = (FAR void *)opriv;
ret = OK;
errout_with_excllock:
errout_with_lock:
nxmutex_unlock(&priv->lock);
return ret;
}
@@ -382,7 +382,7 @@ static int nunchuck_close(FAR struct file *filep)
{
ierr("ERROR: Failed to find open entry\n");
ret = -ENOENT;
goto errout_with_excllock;
goto errout_with_lock;
}
/* Remove the structure from the device */
@@ -402,7 +402,7 @@ static int nunchuck_close(FAR struct file *filep)
ret = OK;
errout_with_excllock:
errout_with_lock:
nxmutex_unlock(&priv->lock);
return ret;
}