| 1370 | } |
| 1371 | |
| 1372 | rt_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 | |
| 1407 | void rt_sdio_init(void) |
| 1408 | { |
nothing calls this directly
no test coverage detected