@@ -2,6 +2,7 @@
/* Copyright (C) 2019 ASPEED Technology Inc. */
/* Copyright (C) 2019 IBM Corp. */
+#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -131,8 +132,8 @@ aspeed_sdc_set_phase_tap(const struct aspeed_sdhci_tap_desc *desc,
{
reg &= ~(desc->enable_mask | desc->tap_mask);
if (enable) {
- reg |= tap << __ffs(desc->tap_mask);
- reg |= desc->enable_value << __ffs(desc->enable_mask);
+ reg |= field_prep(desc->tap_mask, tap);
+ reg |= field_prep(desc->enable_mask, desc->enable_value);
}
return reg;
Use the field_prep() helper, instead open-coding the same operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- Compile-tested only. Marked RFC, as this depends on [PATCH 01/17], but follows a different path to upstream. --- drivers/mmc/host/sdhci-of-aspeed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)