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>
This commit is contained in:
Chris Ruehl 2013-12-06 16:35:12 +08:00 committed by Greg Kroah-Hartman
parent 9058bdc3a8
commit aeb2c1210d

View file

@ -208,7 +208,8 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >> reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >>
__ffs(HCCPARAMS_LEN); __ffs(HCCPARAMS_LEN);
ci->hw_bank.lpm = reg; 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 = ci->hw_bank.op - ci->hw_bank.abs;
ci->hw_bank.size += OP_LAST; ci->hw_bank.size += OP_LAST;
ci->hw_bank.size /= sizeof(u32); ci->hw_bank.size /= sizeof(u32);