Skip to content

Commit

Permalink
arch: cxd56xx: Fix eMMC uninitialize function
Browse files Browse the repository at this point in the history
- Fix prototype function with prefix of cxd56.
- Add logic to unregister blockdriver.
- Minor fix nxstyle.
  • Loading branch information
SPRESENSE committed Dec 20, 2022
1 parent 0dc9724 commit 867d87d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions arch/arm/src/cxd56xx/cxd56_emmc.c
Expand Up @@ -942,6 +942,10 @@ static int cxd56_emmc_geometry(struct inode *inode,
return OK;
}

/****************************************************************************
* Public Functions
****************************************************************************/

int cxd56_emmcinitialize(void)
{
struct cxd56_emmc_state_s *priv;
Expand Down Expand Up @@ -984,21 +988,25 @@ int cxd56_emmcinitialize(void)
}

ret = register_blockdriver("/dev/emmc0", &g_bops, 0, priv);
if (ret)
if (ret < 0)
{
ferr("register_blockdriver failed: %d\n", -ret);
return ret;
}

return OK;
return ret;
}

/****************************************************************************
* Public Functions
****************************************************************************/

int emmc_uninitialize(void)
int cxd56_emmcuninitialize(void)
{
int ret;

ret = unregister_blockdriver("/dev/emmc0");
if (ret < 0)
{
ferr("unregister_blockdriver failed: %d\n", -ret);
return ret;
}

/* Send power off command */

emmc_switchcmd(EXTCSD_PON, EXTCSD_PON_POWERED_OFF_LONG);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/cxd56xx/cxd56_emmc.h
Expand Up @@ -43,7 +43,7 @@ extern "C"
****************************************************************************/

int cxd56_emmcinitialize(void);
void cxd56_emmcuninitialize(void);
int cxd56_emmcuninitialize(void);

#undef EXTERN
#ifdef __cplusplus
Expand Down

0 comments on commit 867d87d

Please sign in to comment.