Skip to content

Commit

Permalink
rammtd:add rammtd_uninitialize
Browse files Browse the repository at this point in the history
Summary:
  Added rammtd_uninitialize to manage rammtd

Signed-off-by: chenrun1 <[email protected]>
  • Loading branch information
crafcat7 authored and xiaoxiang781216 committed Nov 12, 2024
1 parent ee6e62c commit 0bad7f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/mtd/rammtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
13 changes: 13 additions & 0 deletions include/nuttx/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 0bad7f8

Please sign in to comment.