mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
AT24xx: Add logic to unregister from the procfs file system if the driver is uninitialized
This commit is contained in:
@@ -687,6 +687,15 @@ void at24c_uninitialize(FAR struct mtd_dev_s *mtd)
|
|||||||
{
|
{
|
||||||
FAR struct at24c_dev_s *priv = (FAR struct at24c_dev_s *)mtd;
|
FAR struct at24c_dev_s *priv = (FAR struct at24c_dev_s *)mtd;
|
||||||
DEBUGASSERT(priv != NULL);
|
DEBUGASSERT(priv != NULL);
|
||||||
|
|
||||||
|
#ifdef CONFIG_MTD_REGISTRATION
|
||||||
|
/* Unregister the MTD with the procfs system if enabled */
|
||||||
|
|
||||||
|
mtd_unregister(&priv->mtd);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Free the MTD driver instance */
|
||||||
|
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_AT24XX_MULTI */
|
#endif /* CONFIG_AT24XX_MULTI */
|
||||||
|
|||||||
Reference in New Issue
Block a user