Browse Source

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>
Christian Lütke-Stetzkamp 7 years ago
parent
commit
bffcc2e923
1 changed files with 9 additions and 7 deletions
  1. 9 7
      drivers/staging/mt7621-mmc/mt6575_sd.h

+ 9 - 7
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);			\