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

Function sdio_register_card

components/drivers/sdio/dev_sdio.c:795–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795static 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
825out:
826 return 0;
827}
828
829static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr)
830{

Callers 1

sdio_init_cardFunction · 0.85

Calls 4

rt_mallocFunction · 0.85
rt_list_insert_afterFunction · 0.85
rt_list_isemptyFunction · 0.85
sdio_match_cardFunction · 0.85

Tested by

no test coverage detected