summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorruiqian <[email protected]>2017-04-19 20:03:11 +0800
committerGitHub <[email protected]>2017-04-19 20:03:11 +0800
commitf136f8895a5e97a3e3a644668b657af9ac845327 (patch)
tree4bf69fbd50b34a1267f929f19d0eb1b954c26d94 /components
parent24185f472121843d0bddaa684b6ab47d2a6bcbcc (diff)
Update sdio.c
Diffstat (limited to 'components')
-rw-r--r--components/drivers/sdio/sdio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c
index ee77b7adbb..78ebf3119b 100644
--- a/components/drivers/sdio/sdio.c
+++ b/components/drivers/sdio/sdio.c
@@ -1169,7 +1169,8 @@ rt_int32_t sdio_detach_irq(struct rt_sdio_function *func)
void sdio_irq_wakeup(struct rt_mmcsd_host *host)
{
- host->ops->enable_sdio_irq(host, 0);
+ if (host->flags & MMCSD_SUP_SDIO_IRQ)
+ host->ops->enable_sdio_irq(host, 0);
rt_sem_release(host->sdio_irq_sem);
}
@@ -1197,7 +1198,7 @@ rt_int32_t sdio_enable_func(struct rt_sdio_function *func)
if (ret)
goto err;
- timeout = rt_tick_get() + func->enable_timeout_val * 1000 / RT_TICK_PER_SECOND;
+ timeout = rt_tick_get() + func->enable_timeout_val * RT_TICK_PER_SECOND / 1000;
while (1)
{
@@ -1287,7 +1288,7 @@ rt_inline rt_int32_t sdio_match_card(struct rt_mmcsd_card *card,
(id->manufacturer != card->cis.manufacturer))
return 0;
if ((id->product != SDIO_ANY_PROD_ID) &&
- (id->product != card->cis.product))
+ (id->product != (card->cis.product | 1)))
return 0;
return 1;
@@ -1334,11 +1335,11 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver)
card = sdio_match_driver(driver->id);
if (card != RT_NULL)
{
- driver->probe(card);
+ return driver->probe(card);
}
}
- return 0;
+ return -RT_EEMPTY;
}
rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)