Skip to content

Commit

Permalink
mmc: samsung's workaround for div by zero problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokhan Moral committed Sep 5, 2012
1 parent cc3293a commit b770e6f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,19 +645,15 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
/* timeout in us */
if (!data)
target_timeout = cmd->cmd_timeout_ms * 1000;
else {
/* patch added for divide by zero once issue for P2_USA_TMO project. */
#ifndef CONFIG_TARGET_LOCALE_P2TMO_TEMP
target_timeout = data->timeout_ns / 1000 +
data->timeout_clks / host->clock;
#else
if (host!=NULL)
target_timeout = data->timeout_ns / 1000 +
data->timeout_clks / host->clock;
else {
/* patch added for divide by zero once issue. */
if (host && host->clock)
target_timeout = data->timeout_ns / 1000 +
data->timeout_clks / host->clock;
else
return 0;
#endif
}
}

if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
host->timeout_clk = host->clock / 1000;

Expand Down

0 comments on commit b770e6f

Please sign in to comment.