MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_devfs_update

Function dfs_devfs_update

components/dfs/dfs_v2/filesystems/devfs/devfs.c:536–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536int dfs_devfs_update(void)
537{
538 int count = rt_object_get_length(RT_Object_Class_Device);
539 if (count > 0)
540 {
541 rt_device_t *devices = rt_malloc(count * sizeof(rt_device_t));
542 if (devices)
543 {
544 rt_object_get_pointers(RT_Object_Class_Device, (rt_object_t *)devices, count);
545
546 for (int index = 0; index < count; index ++)
547 {
548 dfs_devfs_device_add(devices[index]);
549 }
550 rt_free(devices);
551 }
552 }
553
554 return count;
555}

Callers 1

dfs_devtmpfs_initFunction · 0.85

Calls 5

rt_object_get_lengthFunction · 0.85
rt_mallocFunction · 0.85
rt_object_get_pointersFunction · 0.85
dfs_devfs_device_addFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected