diff options
author | Christian Lütke-Stetzkamp <christian@lkamp.de> | 2018-04-29 19:32:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-06 19:08:05 -0700 |
commit | 8f1c27c98172dc5040782ec4b18715697aeb78e6 (patch) | |
tree | 70f7c9ebb7d9ce4facb0751af6a419d64b119d4b /drivers/staging/mt7621-mmc | |
parent | bffcc2e9234f6d7d8c6046250ac69348c0097eb3 (diff) | |
download | blackbird-obmc-linux-8f1c27c98172dc5040782ec4b18715697aeb78e6.tar.gz blackbird-obmc-linux-8f1c27c98172dc5040782ec4b18715697aeb78e6.zip |
staging: mt7621-mmc: Replace macro sdr_get_field with function
Currently sdr_get_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.h | 10 | ||||
-rw-r--r-- | drivers/staging/mt7621-mmc/sd.c | 14 |
2 files changed, 13 insertions, 11 deletions
diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index 90b4ee6b396b..195c7333f77d 100644 --- a/drivers/staging/mt7621-mmc/mt6575_sd.h +++ b/drivers/staging/mt7621-mmc/mt6575_sd.h @@ -980,10 +980,10 @@ static inline void sdr_set_field(void __iomem *reg, u32 field, u32 val) writel(tv, reg); } -#define sdr_get_field(reg, field, val) \ -do { \ - volatile unsigned int tv = sdr_read32(reg); \ - val = ((tv & (field)) >> (ffs((unsigned int)field) - 1)); \ -} while (0) +static inline void sdr_get_field(void __iomem *reg, u32 field, u32 *val) +{ + unsigned int tv = readl(reg); + *val = ((tv & field) >> (ffs((unsigned int)field) - 1)); +} #endif diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 00dacf8c9625..f4da48a5772b 100644 --- a/drivers/staging/mt7621-mmc/sd.c +++ b/drivers/staging/mt7621-mmc/sd.c @@ -1577,8 +1577,8 @@ static int msdc_tune_cmdrsp(struct msdc_host *host, struct mmc_command *cmd) ==========================*/ // save the previous tune result - sdr_get_field(MSDC_IOCON, MSDC_IOCON_RSPL, orig_rsmpl); - sdr_get_field(MSDC_PAD_TUNE, MSDC_PAD_TUNE_CMDRRDLY, orig_rrdly); + sdr_get_field(MSDC_IOCON, MSDC_IOCON_RSPL, &orig_rsmpl); + sdr_get_field(MSDC_PAD_TUNE, MSDC_PAD_TUNE_CMDRRDLY, &orig_rrdly); rrdly = 0; do { @@ -1640,7 +1640,7 @@ static int msdc_tune_bread(struct mmc_host *mmc, struct mmc_request *mrq) int result = -1; u32 skip = 1; - sdr_get_field(MSDC_IOCON, MSDC_IOCON_DSPL, orig_dsmpl); + sdr_get_field(MSDC_IOCON, MSDC_IOCON_DSPL, &orig_dsmpl); /* Tune Method 2. */ sdr_set_field(MSDC_IOCON, MSDC_IOCON_DDLSEL, 1); @@ -1664,7 +1664,9 @@ static int msdc_tune_bread(struct mmc_host *mmc, struct mmc_request *mrq) } result = msdc_do_request(mmc, mrq); - sdr_get_field(SDC_DCRC_STS, SDC_DCRC_STS_POS | SDC_DCRC_STS_NEG, dcrc); /* RO */ + sdr_get_field(SDC_DCRC_STS, + SDC_DCRC_STS_POS | SDC_DCRC_STS_NEG, + &dcrc); /* RO */ if (!ddr) dcrc &= ~SDC_DCRC_STS_NEG; ERR_MSG("TUNE_BREAD<%s> dcrc<0x%x> DATRDDLY0/1<0x%x><0x%x> dsmpl<0x%x>", @@ -1751,8 +1753,8 @@ static int msdc_tune_bwrite(struct mmc_host *mmc, struct mmc_request *mrq) // MSDC_IOCON_DDR50CKD need to check. [Fix me] - sdr_get_field(MSDC_PAD_TUNE, MSDC_PAD_TUNE_DATWRDLY, orig_wrrdly); - sdr_get_field(MSDC_IOCON, MSDC_IOCON_DSPL, orig_dsmpl); + sdr_get_field(MSDC_PAD_TUNE, MSDC_PAD_TUNE_DATWRDLY, &orig_wrrdly); + sdr_get_field(MSDC_IOCON, MSDC_IOCON_DSPL, &orig_dsmpl); /* Tune Method 2. just DAT0 */ sdr_set_field(MSDC_IOCON, MSDC_IOCON_DDLSEL, 1); |