diff options
author | Chris Ruehl <chris.ruehl@gtsys.com.hk> | 2013-12-06 03:35:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 21:02:54 -0500 |
commit | aeb2c1210d71c00a4b59d343b0a7df6b1059eb89 (patch) | |
tree | 785bd1dd7889fc3e0f28267614a497d5a3defc50 /drivers/usb/chipidea/core.c | |
parent | 9058bdc3a8fbfe1a528019466df62635ef1f7a94 (diff) |
usb: chipidea: Reallocate regmap only if lpm is detected
The regmap only needs to reallocate if the hw_read on the CAP register shows
lpm is used. Therefore the if() statement check the change.
Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r-- | drivers/usb/chipidea/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 5d8981c5235e..50754073fae0 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -208,7 +208,8 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base) | |||
208 | reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >> | 208 | reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >> |
209 | __ffs(HCCPARAMS_LEN); | 209 | __ffs(HCCPARAMS_LEN); |
210 | ci->hw_bank.lpm = reg; | 210 | ci->hw_bank.lpm = reg; |
211 | hw_alloc_regmap(ci, !!reg); | 211 | if (reg) |
212 | hw_alloc_regmap(ci, !!reg); | ||
212 | ci->hw_bank.size = ci->hw_bank.op - ci->hw_bank.abs; | 213 | ci->hw_bank.size = ci->hw_bank.op - ci->hw_bank.abs; |
213 | ci->hw_bank.size += OP_LAST; | 214 | ci->hw_bank.size += OP_LAST; |
214 | ci->hw_bank.size /= sizeof(u32); | 215 | ci->hw_bank.size /= sizeof(u32); |