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:
Thorsten Blum
2025-12-22 11:03:33 +01:00
committed by Ulf Hansson
parent 658b716c04
commit 0621d52b1d

View File

@@ -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)