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

Function sdio_register_driver

components/drivers/sdio/dev_sdio.c:1344–1370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1342}
1343
1344rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver)
1345{
1346 struct sdio_driver *sd;
1347 struct rt_mmcsd_card *card;
1348
1349 sd = rt_malloc(sizeof(struct sdio_driver));
1350 if (sd == RT_NULL)
1351 {
1352 LOG_E("malloc sdio driver failed");
1353
1354 return -RT_ENOMEM;
1355 }
1356
1357 sd->drv = driver;
1358 rt_list_insert_after(&sdio_drivers, &sd->list);
1359
1360 if (!rt_list_isempty(&sdio_cards))
1361 {
1362 card = sdio_match_driver(driver->id);
1363 if (card != RT_NULL)
1364 {
1365 return driver->probe(card);
1366 }
1367 }
1368
1369 return -RT_EEMPTY;
1370}
1371
1372rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
1373{

Callers

nothing calls this directly

Calls 4

rt_mallocFunction · 0.85
rt_list_insert_afterFunction · 0.85
rt_list_isemptyFunction · 0.85
sdio_match_driverFunction · 0.85

Tested by

no test coverage detected