Commit bffcc2e9 authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

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: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35af3110
...@@ -971,13 +971,15 @@ static inline void sdr_clr_bits(void __iomem *reg, u32 bs) ...@@ -971,13 +971,15 @@ static inline void sdr_clr_bits(void __iomem *reg, u32 bs)
writel(val, reg); writel(val, reg);
} }
#define sdr_set_field(reg, field, val) \ static inline void sdr_set_field(void __iomem *reg, u32 field, u32 val)
do { \ {
volatile unsigned int tv = sdr_read32(reg); \ unsigned int tv = readl(reg);
tv &= ~(field); \
tv |= ((val) << (ffs((unsigned int)field) - 1)); \ tv &= ~field;
sdr_write32(reg, tv); \ tv |= ((val) << (ffs((unsigned int)field) - 1));
} while (0) writel(tv, reg);
}
#define sdr_get_field(reg, field, val) \ #define sdr_get_field(reg, field, val) \
do { \ do { \
volatile unsigned int tv = sdr_read32(reg); \ volatile unsigned int tv = sdr_read32(reg); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment