mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 12:31:52 -04:00
mmc: cavium: Use clamp to simplify cvm_mmc_set_clock
Use clamp() to simplify cvm_mmc_set_clock() and improve its readability. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
committed by
Ulf Hansson
parent
658b716c04
commit
0621d52b1d
@@ -905,9 +905,7 @@ static void cvm_mmc_set_clock(struct cvm_mmc_slot *slot, unsigned int clock)
|
||||
{
|
||||
struct mmc_host *mmc = slot->mmc;
|
||||
|
||||
clock = min(clock, mmc->f_max);
|
||||
clock = max(clock, mmc->f_min);
|
||||
slot->clock = clock;
|
||||
slot->clock = clamp(clock, mmc->f_min, mmc->f_max);
|
||||
}
|
||||
|
||||
static int cvm_mmc_init_lowlevel(struct cvm_mmc_slot *slot)
|
||||
|
||||
Reference in New Issue
Block a user