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
@ -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…
Reference in New Issue
Block a user