Skip to content

Commit

Permalink
[DM/FIXUP] Fixup block value init
Browse files Browse the repository at this point in the history
Signed-off-by: GuEe-GUI <[email protected]>
  • Loading branch information
GuEe-GUI authored and Rbb666 committed Dec 13, 2024
1 parent 78f318a commit 1c54ff4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/drivers/block/blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ static rt_err_t blk_control(rt_device_t dev, int cmd, void *args)
{
err = disk->ops->control(disk, RT_NULL, cmd, args);
}
else
{
err = -RT_ENOSYS;
}
break;
}

Expand Down Expand Up @@ -344,7 +348,7 @@ rt_err_t rt_hw_blk_disk_unregister(struct rt_blk_disk *disk)

spin_lock(&disk->lock);

if (disk->parent.ref_count != 1)
if (disk->parent.ref_count > 0)
{
err = -RT_EBUSY;
goto _unlock;
Expand Down Expand Up @@ -470,7 +474,7 @@ INIT_ENV_EXPORT(blk_dfs_mnt_table);
const char *convert_size(struct rt_device_blk_geometry *geome,
rt_size_t sector_count, rt_size_t *out_cap, rt_size_t *out_minor)
{
rt_size_t cap, minor;
rt_size_t cap, minor = 0;
int size_index = 0;
const char *size_name[] = { "B", "K", "M", "G", "T", "P", "E" };

Expand Down

0 comments on commit 1c54ff4

Please sign in to comment.