aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-07-05 08:57:52 -0400
committerFelipe Balbi <balbi@ti.com>2011-07-05 09:41:14 -0400
commitc2b65f8422a3f51435c9f60f9752a6ed82d47e13 (patch)
tree80ca8d4d59dc45e8d1e352249718019e6ce94826 /drivers/usb
parent7b30d19a5736b930c39cd7212ae9409ac0df525d (diff)
usb: gadget: ci13xx_udc.c: fix compile warning
Fix the following compile warning: | usb/gadget/ci13xxx_udc.c: In function 'show_registers': | usb/gadget/ci13xxx_udc.c:1242:1: warning: the frame size of 2064 bytes is larger than 1024 bytes Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 082471650fbc..1265a8502ea0 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -1214,12 +1214,13 @@ static DEVICE_ATTR(qheads, S_IRUSR, show_qheads, NULL);
1214 * 1214 *
1215 * Check "device.h" for details 1215 * Check "device.h" for details
1216 */ 1216 */
1217#define DUMP_ENTRIES 512
1217static ssize_t show_registers(struct device *dev, 1218static ssize_t show_registers(struct device *dev,
1218 struct device_attribute *attr, char *buf) 1219 struct device_attribute *attr, char *buf)
1219{ 1220{
1220 struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev); 1221 struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev);
1221 unsigned long flags; 1222 unsigned long flags;
1222 u32 dump[512]; 1223 u32 *dump;
1223 unsigned i, k, n = 0; 1224 unsigned i, k, n = 0;
1224 1225
1225 dbg_trace("[%s] %p\n", __func__, buf); 1226 dbg_trace("[%s] %p\n", __func__, buf);
@@ -1228,8 +1229,14 @@ static ssize_t show_registers(struct device *dev,
1228 return 0; 1229 return 0;
1229 } 1230 }
1230 1231
1232 dump = kmalloc(sizeof(u32) * DUMP_ENTRIES, GFP_KERNEL);
1233 if (!dump) {
1234 dev_err(dev, "%s: out of memory\n", __func__);
1235 return 0;
1236 }
1237
1231 spin_lock_irqsave(udc->lock, flags); 1238 spin_lock_irqsave(udc->lock, flags);
1232 k = hw_register_read(dump, sizeof(dump)/sizeof(u32)); 1239 k = hw_register_read(dump, DUMP_ENTRIES);
1233 spin_unlock_irqrestore(udc->lock, flags); 1240 spin_unlock_irqrestore(udc->lock, flags);
1234 1241
1235 for (i = 0; i < k; i++) { 1242 for (i = 0; i < k; i++) {
@@ -1237,6 +1244,7 @@ static ssize_t show_registers(struct device *dev,
1237 "reg[0x%04X] = 0x%08X\n", 1244 "reg[0x%04X] = 0x%08X\n",
1238 i * (unsigned)sizeof(u32), dump[i]); 1245 i * (unsigned)sizeof(u32), dump[i]);
1239 } 1246 }
1247 kfree(dump);
1240 1248
1241 return n; 1249 return n;
1242} 1250}