mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
[MTD/SmartFS] Extract register_driver call to own function
This commit is contained in:
committed by
Xiang Xiao
parent
631a8da1e2
commit
28f92e8238
+14
-4
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user