get_timer() returns an unsigned long value. This may be 64bit wide on
64bit archs. Storing this value in an unsigned int will cut off the
upper half of the value leading to miscalculation of the elapsed time,
if the upper 32bits of the current timestamp are non-zero.
{
struct mmc_cmd cmd;
int timeout = 10 * CONFIG_SYS_HZ;
- uint start;
+ unsigned long start;
int err;
mmc->op_cond_pending = 0;
int mmc_init(struct mmc *mmc)
{
int err = 0;
- unsigned start;
+ unsigned long start;
#ifdef CONFIG_DM_MMC
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(mmc->dev);
u32 mask, flags, mode;
unsigned int time = 0, start_addr = 0;
int mmc_dev = mmc_get_blk_desc(mmc)->devnum;
- unsigned start = get_timer(0);
+ unsigned long start = get_timer(0);
/* Timeout unit - ms */
unsigned int cmd_timeout;