[sdio] free memory and enhance performance
This commit is contained in:
parent
d514fea54a
commit
f62d8938dc
|
@ -251,6 +251,9 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func,
|
||||||
rt_uint32_t left_size;
|
rt_uint32_t left_size;
|
||||||
rt_uint32_t max_blks, blks;
|
rt_uint32_t max_blks, blks;
|
||||||
|
|
||||||
|
RT_ASSERT(func != RT_NULL);
|
||||||
|
RT_ASSERT(func->card != RT_NULL);
|
||||||
|
|
||||||
left_size = len;
|
left_size = len;
|
||||||
|
|
||||||
/* Do the bulk of the transfer using block mode (if supported). */
|
/* Do the bulk of the transfer using block mode (if supported). */
|
||||||
|
@ -575,22 +578,26 @@ static rt_int32_t sdio_read_cis(struct rt_sdio_function *func)
|
||||||
if (tpl_link < 4)
|
if (tpl_link < 4)
|
||||||
{
|
{
|
||||||
LOG_D("bad CISTPL_MANFID length");
|
LOG_D("bad CISTPL_MANFID length");
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (func->num != 0)
|
|
||||||
{
|
|
||||||
func->manufacturer = curr->data[0];
|
|
||||||
func->manufacturer |= curr->data[1] << 8;
|
|
||||||
func->product = curr->data[2];
|
|
||||||
func->product |= curr->data[3] << 8;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
card->cis.manufacturer = curr->data[0];
|
if (func->num != 0)
|
||||||
card->cis.manufacturer |= curr->data[1] << 8;
|
{
|
||||||
card->cis.product = curr->data[2];
|
func->manufacturer = curr->data[0];
|
||||||
card->cis.product |= curr->data[3] << 8;
|
func->manufacturer |= curr->data[1] << 8;
|
||||||
|
func->product = curr->data[2];
|
||||||
|
func->product |= curr->data[3] << 8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
card->cis.manufacturer = curr->data[0];
|
||||||
|
card->cis.manufacturer |= curr->data[1] << 8;
|
||||||
|
card->cis.product = curr->data[2];
|
||||||
|
card->cis.product |= curr->data[3] << 8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rt_free(curr);
|
||||||
break;
|
break;
|
||||||
case CISTPL_FUNCE:
|
case CISTPL_FUNCE:
|
||||||
if (func->num != 0)
|
if (func->num != 0)
|
||||||
|
@ -930,9 +937,6 @@ err3:
|
||||||
sdio_free_cis(host->card->sdio_function[i]);
|
sdio_free_cis(host->card->sdio_function[i]);
|
||||||
rt_free(host->card->sdio_function[i]);
|
rt_free(host->card->sdio_function[i]);
|
||||||
host->card->sdio_function[i] = RT_NULL;
|
host->card->sdio_function[i] = RT_NULL;
|
||||||
rt_free(host->card);
|
|
||||||
host->card = RT_NULL;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue