[MTD/SmartFS] Extract register_driver call to own function

This commit is contained in:
Oleksandr Oryshchenko
2023-01-29 16:42:59 +01:00
committed by Xiang Xiao
parent 631a8da1e2
commit 28f92e8238
2 changed files with 18 additions and 4 deletions
+14 -4
View File
@@ -6289,10 +6289,6 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd,
}
}
#ifdef CONFIG_SMART_DEV_LOOP
register_driver("/dev/smart", &g_fops, 0666, NULL);
#endif
return OK;
errout:
@@ -6320,6 +6316,20 @@ errout:
return ret;
}
/****************************************************************************
* Name: smart_loop_register_driver
*
* Description:
* Registers SmartFS Loop Driver
****************************************************************************/
#ifdef CONFIG_SMART_DEV_LOOP
int smart_loop_register_driver(void)
{
return register_driver("/dev/smart", &g_fops, 0666, NULL);
}
#endif
/****************************************************************************
* Name: smart_losetup
*
+4
View File
@@ -152,6 +152,10 @@ extern "C"
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_SMART_DEV_LOOP
int smart_loop_register_driver(void);
#endif
#undef EXTERN
#ifdef __cplusplus
}