diff options
| author | hichard <[email protected]> | 2019-11-16 11:16:48 +0800 |
|---|---|---|
| committer | hichard <[email protected]> | 2019-11-16 11:16:48 +0800 |
| commit | aafed7b43455d6e2d66d5e36e8f3d849b677e195 (patch) | |
| tree | 467dd7025aafb8c4e915b82a3682f41027882535 /components/drivers | |
| parent | 69e8c0324e77d7c30634d2a74264fd4fc171ec24 (diff) | |
1.修复sd卡热插拔内存泄露的bug
2.dfs增加函数,配合实现sd卡热插拔自动挂载卸载文件系统
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/sdio/block_dev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index cac4fc5036..5db0f38c08 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -472,7 +472,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) } #ifdef RT_USING_DFS_MNTTABLE - if (0) // if (blk_dev) + if (blk_dev) { LOG_I("try to mount file system!"); /* try to mount file system on this block device */ @@ -507,9 +507,10 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card) const char * mounted_path = dfs_filesystem_get_mounted_path(&(blk_dev->dev)); if (mounted_path) { - dfs_unmount(mounted_path); + dfs_unmount(mounted_path); + LOG_D("unmount file system %s for device %s.\r\n", mounted_path, blk_dev->dev.parent.name); } - + rt_sem_delete(blk_dev->part.lock); rt_device_unregister(&blk_dev->dev); rt_list_remove(&blk_dev->list); rt_free(blk_dev); |
