diff options
| -rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 24ba80b70bd3..f2f2f2af7ba2 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
| @@ -74,10 +74,6 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask, | |||
| 74 | u32 value) | 74 | u32 value) |
| 75 | { | 75 | { |
| 76 | u32 reg_val; | 76 | u32 reg_val; |
| 77 | u32 errconfig_offs = 0, errconfig_mask = 0; | ||
| 78 | |||
| 79 | reg_val = __raw_readl(sr->base + offset); | ||
| 80 | reg_val &= ~mask; | ||
| 81 | 77 | ||
| 82 | /* | 78 | /* |
| 83 | * Smartreflex error config register is special as it contains | 79 | * Smartreflex error config register is special as it contains |
| @@ -88,16 +84,15 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask, | |||
| 88 | * if they are currently set, but does allow the caller to write | 84 | * if they are currently set, but does allow the caller to write |
| 89 | * those bits. | 85 | * those bits. |
| 90 | */ | 86 | */ |
| 91 | if (sr->ip_type == SR_TYPE_V1) { | 87 | if (sr->ip_type == SR_TYPE_V1 && offset == ERRCONFIG_V1) |
| 92 | errconfig_offs = ERRCONFIG_V1; | 88 | mask |= ERRCONFIG_STATUS_V1_MASK; |
| 93 | errconfig_mask = ERRCONFIG_STATUS_V1_MASK; | 89 | else if (sr->ip_type == SR_TYPE_V2 && offset == ERRCONFIG_V2) |
| 94 | } else if (sr->ip_type == SR_TYPE_V2) { | 90 | mask |= ERRCONFIG_VPBOUNDINTST_V2; |
| 95 | errconfig_offs = ERRCONFIG_V2; | 91 | |
| 96 | errconfig_mask = ERRCONFIG_VPBOUNDINTST_V2; | 92 | reg_val = __raw_readl(sr->base + offset); |
| 97 | } | 93 | reg_val &= ~mask; |
| 98 | 94 | ||
| 99 | if (offset == errconfig_offs) | 95 | value &= mask; |
| 100 | reg_val &= ~errconfig_mask; | ||
| 101 | 96 | ||
| 102 | reg_val |= value; | 97 | reg_val |= value; |
| 103 | 98 | ||
