summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChris Ruehl <chris.ruehl@gtsys.com.hk>2013-12-06 16:35:12 +0800
committerPeter Chen <peter.chen@freescale.com>2014-01-16 16:56:45 +0800
commite8504b498e8ef6eb577b15db423e2a13af9085ba (patch)
treead937921b8a1d4f960eb84b1091a4c9478a7d5ac /drivers
parentd440d1f97857d914bb90d19fe9896bbca303e011 (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> (cherry picked from commit 57fadc36d11a1263b446ef6f5d474d529274faa8)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 5ef0a15605e0..fb38df9356d4 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -213,7 +213,8 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >>
__ffs(HCCPARAMS_LEN);
ci->hw_bank.lpm = reg;
- hw_alloc_regmap(ci, !!reg);
+ if (reg)
+ hw_alloc_regmap(ci, !!reg);
ci->hw_bank.size = ci->hw_bank.op - ci->hw_bank.abs;
ci->hw_bank.size += OP_LAST;
ci->hw_bank.size /= sizeof(u32);