aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/core.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2014-01-05 21:10:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-07 19:21:06 -0500
commit21395a1aac7ce1e19dbb43542a9e06cca2bfca01 (patch)
tree23348c191684e158cd314e9aaea5eea8ac254452 /drivers/usb/chipidea/core.c
parent2627cb08129d7fa152f97dd0732736fb2df516ee (diff)
usb: chipidea: move malloced regmap directly into struct hw_bank
Without this patch a seperate chunk of memory is allocated for the regmap array. As the regmap is always used it makes no sense to allocate a seperate memory block for it, this patch moves the regmap array directly into the struct hw_bank. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> 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.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 9a5ef205cffd..b9385c1034ac 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -123,13 +123,6 @@ static int hw_alloc_regmap(struct ci_hdrc *ci, bool is_lpm)
123{ 123{
124 int i; 124 int i;
125 125
126 kfree(ci->hw_bank.regmap);
127
128 ci->hw_bank.regmap = kzalloc((OP_LAST + 1) * sizeof(void *),
129 GFP_KERNEL);
130 if (!ci->hw_bank.regmap)
131 return -ENOMEM;
132
133 for (i = 0; i < OP_ENDPTCTRL; i++) 126 for (i = 0; i < OP_ENDPTCTRL; i++)
134 ci->hw_bank.regmap[i] = 127 ci->hw_bank.regmap[i] =
135 (i <= CAP_LAST ? ci->hw_bank.cap : ci->hw_bank.op) + 128 (i <= CAP_LAST ? ci->hw_bank.cap : ci->hw_bank.op) +
@@ -681,7 +674,6 @@ static int ci_hdrc_remove(struct platform_device *pdev)
681 ci_role_destroy(ci); 674 ci_role_destroy(ci);
682 ci_hdrc_enter_lpm(ci, true); 675 ci_hdrc_enter_lpm(ci, true);
683 ci_usb_phy_destroy(ci); 676 ci_usb_phy_destroy(ci);
684 kfree(ci->hw_bank.regmap);
685 677
686 return 0; 678 return 0;
687} 679}