rammtd:add rammtd_uninitialize

Summary:
  Added rammtd_uninitialize to manage rammtd

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-10-16 14:42:25 +08:00 committed by Xiang Xiao
parent ee6e62c3ce
commit 0bad7f814a
2 changed files with 31 additions and 0 deletions

View file

@ -520,3 +520,21 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
return &priv->mtd;
}
/****************************************************************************
* Name: rammtd_uninitialize
*
* Description:
* Free the resources associated with a RAM MTD device instance.
*
* Input Parameters:
* dev - Pointer to the MTD device instance to be uninitialized.
*
****************************************************************************/
void rammtd_uninitialize(FAR struct mtd_dev_s *dev)
{
FAR struct ram_dev_s *priv = (FAR struct ram_dev_s *)dev;
kmm_free(priv);
}

View file

@ -490,6 +490,19 @@ FAR struct mtd_dev_s *mx35_initialize(FAR struct spi_dev_s *dev);
FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size);
/****************************************************************************
* Name: rammtd_uninitialize
*
* Description:
* Free the resources associated with a RAM MTD device instance.
*
* Input Parameters:
* dev - Pointer to the MTD device instance to be uninitialized.
*
****************************************************************************/
void rammtd_uninitialize(FAR struct mtd_dev_s *dev);
/****************************************************************************
* Name: ramtron_initialize
*