| 793 | } |
| 794 | |
| 795 | static rt_int32_t sdio_register_card(struct rt_mmcsd_card *card) |
| 796 | { |
| 797 | struct sdio_card *sc; |
| 798 | struct sdio_driver *sd; |
| 799 | rt_list_t *l; |
| 800 | |
| 801 | sc = rt_malloc(sizeof(struct sdio_card)); |
| 802 | if (sc == RT_NULL) |
| 803 | { |
| 804 | LOG_E("malloc sdio card failed"); |
| 805 | return -RT_ENOMEM; |
| 806 | } |
| 807 | |
| 808 | sc->card = card; |
| 809 | rt_list_insert_after(&sdio_cards, &sc->list); |
| 810 | |
| 811 | if (rt_list_isempty(&sdio_drivers)) |
| 812 | { |
| 813 | goto out; |
| 814 | } |
| 815 | |
| 816 | for (l = (&sdio_drivers)->next; l != &sdio_drivers; l = l->next) |
| 817 | { |
| 818 | sd = (struct sdio_driver *)rt_list_entry(l, struct sdio_driver, list); |
| 819 | if (sdio_match_card(card, sd->drv->id)) |
| 820 | { |
| 821 | sd->drv->probe(card); |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | out: |
| 826 | return 0; |
| 827 | } |
| 828 | |
| 829 | static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) |
| 830 | { |
no test coverage detected