mirror of
https://github.com/apache/nuttx.git
synced 2026-08-19 04:28:21 +00:00
bl602/spi: add reference in bl602_spibus_initialize
and unlock the mutex before return Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
8098c80338
commit
e244720aa4
1 changed files with 3 additions and 1 deletions
|
|
@ -1671,7 +1671,7 @@ struct spi_dev_s *bl602_spibus_initialize(int port)
|
|||
nxmutex_lock(&priv->lock);
|
||||
if (priv->refs != 0)
|
||||
{
|
||||
priv->refs--;
|
||||
priv->refs++;
|
||||
nxmutex_unlock(&priv->lock);
|
||||
|
||||
return spi_dev;
|
||||
|
|
@ -1711,6 +1711,8 @@ int bl602_spibus_uninitialize(struct spi_dev_s *dev)
|
|||
}
|
||||
|
||||
bl602_spi_deinit(dev);
|
||||
nxmutex_unlock(&priv->lock);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue