Skip to content

Commit

Permalink
sdhci: be more strict with get_min_clock() usage
Browse files Browse the repository at this point in the history
get_min_clock() makes sense only with NONSTANDARD_CLOCK quirk and when
set_clock() callback is specified.

The patch should cause no functional changes, it just makes the code
self-documented and avoids any possible misuse of get_min_clock().

Suggested-by: Pierre Ossman <pierre@ossman.eu>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Ian Molton <ian@mnementh.co.uk>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: Philip Langdale <philipl@overt.org>
Cc: Pierre Ossman <pierre@ossman.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Anton Vorontsov authored and Linus Torvalds committed Sep 23, 2009
1 parent 006ebd5 commit e951017
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,8 @@ int sdhci_add_host(struct sdhci_host *host)
* Set host parameters.
*/
mmc->ops = &sdhci_ops;
if (host->ops->get_min_clock)
if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
host->ops->set_clock && host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else
mmc->f_min = host->max_clk / 256;
Expand Down

0 comments on commit e951017

Please sign in to comment.