summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-mmc
diff options
context:
space:
mode:
authorChristian Lütke-Stetzkamp <christian@lkamp.de>2018-04-29 19:32:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-06 19:08:05 -0700
commitbffcc2e9234f6d7d8c6046250ac69348c0097eb3 (patch)
treeec3e4c953d9c1188b21d8d3cd86ac3904aa55d51 /drivers/staging/mt7621-mmc
parent35af3110d4c3cb7f3249f55d1c6000544281b10d (diff)
staging: mt7621-mmc: Replace macro sdr_set_field with function
Currently sdr_set_field is a macro, to bring the code in line with the upstream driver mtk-sd, it is changed to a function. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-mmc')
-rw-r--r--drivers/staging/mt7621-mmc/mt6575_sd.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h
index 5a50b6a47469..90b4ee6b396b 100644
--- a/drivers/staging/mt7621-mmc/mt6575_sd.h
+++ b/drivers/staging/mt7621-mmc/mt6575_sd.h
@@ -971,13 +971,15 @@ static inline void sdr_clr_bits(void __iomem *reg, u32 bs)
writel(val, reg);
}
-#define sdr_set_field(reg, field, val) \
-do { \
- volatile unsigned int tv = sdr_read32(reg); \
- tv &= ~(field); \
- tv |= ((val) << (ffs((unsigned int)field) - 1)); \
- sdr_write32(reg, tv); \
-} while (0)
+static inline void sdr_set_field(void __iomem *reg, u32 field, u32 val)
+{
+ unsigned int tv = readl(reg);
+
+ tv &= ~field;
+ tv |= ((val) << (ffs((unsigned int)field) - 1));
+ writel(tv, reg);
+}
+
#define sdr_get_field(reg, field, val) \
do { \
volatile unsigned int tv = sdr_read32(reg); \