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

Function sdio_unregister_driver

components/drivers/sdio/dev_sdio.c:1372–1405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370}
1371
1372rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
1373{
1374 rt_list_t *l;
1375 struct sdio_driver *sd = RT_NULL;
1376 struct rt_mmcsd_card *card;
1377
1378 for (l = (&sdio_drivers)->next; l != &sdio_drivers; l = l->next)
1379 {
1380 sd = (struct sdio_driver *)rt_list_entry(l, struct sdio_driver, list);
1381 if (sd->drv != driver)
1382 {
1383 sd = RT_NULL;
1384 }
1385 }
1386
1387 if (sd == RT_NULL)
1388 {
1389 LOG_E("SDIO driver %s not register", driver->name);
1390 return -RT_ERROR;
1391 }
1392
1393 if (!rt_list_isempty(&sdio_cards))
1394 {
1395 card = sdio_match_driver(driver->id);
1396 if (card != RT_NULL)
1397 {
1398 driver->remove(card);
1399 rt_list_remove(&sd->list);
1400 rt_free(sd);
1401 }
1402 }
1403
1404 return 0;
1405}
1406
1407void rt_sdio_init(void)
1408{

Callers

nothing calls this directly

Calls 4

rt_list_isemptyFunction · 0.85
sdio_match_driverFunction · 0.85
rt_list_removeFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected