diff options
author | David Brownell <david-b@pacbell.net> | 2007-11-19 15:58:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:34:51 -0500 |
commit | 00274921a052d3232d9f00856387fb269ac0af11 (patch) | |
tree | 20d2baa7234c936b7451d76f6da527d43197f994 /drivers/usb | |
parent | 269954e542328f014fc07fbb0a986192f7a1cced (diff) |
USB: gadget code switches to pr_err() and friends
We now have pr_err(), pr_warning(), and friends ... start using
them in the gadget stack instead of printk(KERN_ERR) and friends.
This gives us shorter lines and somewhat increased readability.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/at91_udc.h | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 11 | ||||
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.h | 7 | ||||
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_usb2_udc.h | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/m66592-udc.c | 48 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.h | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.h | 11 | ||||
-rw-r--r-- | drivers/usb/gadget/rndis.c | 20 | ||||
-rw-r--r-- | drivers/usb/gadget/serial.c | 153 | ||||
-rw-r--r-- | drivers/usb/gadget/zero.c | 4 |
14 files changed, 151 insertions, 171 deletions
diff --git a/drivers/usb/gadget/at91_udc.h b/drivers/usb/gadget/at91_udc.h index 7e34e2f864f9..aecc7225a8c6 100644 --- a/drivers/usb/gadget/at91_udc.h +++ b/drivers/usb/gadget/at91_udc.h | |||
@@ -158,12 +158,6 @@ struct at91_request { | |||
158 | 158 | ||
159 | /*-------------------------------------------------------------------------*/ | 159 | /*-------------------------------------------------------------------------*/ |
160 | 160 | ||
161 | #ifdef DEBUG | ||
162 | #define DBG(stuff...) printk(KERN_DEBUG "udc: " stuff) | ||
163 | #else | ||
164 | #define DBG(stuff...) do{}while(0) | ||
165 | #endif | ||
166 | |||
167 | #ifdef VERBOSE | 161 | #ifdef VERBOSE |
168 | # define VDBG DBG | 162 | # define VDBG DBG |
169 | #else | 163 | #else |
@@ -176,9 +170,10 @@ struct at91_request { | |||
176 | # define PACKET(stuff...) do{}while(0) | 170 | # define PACKET(stuff...) do{}while(0) |
177 | #endif | 171 | #endif |
178 | 172 | ||
179 | #define ERR(stuff...) printk(KERN_ERR "udc: " stuff) | 173 | #define ERR(stuff...) pr_err("udc: " stuff) |
180 | #define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) | 174 | #define WARN(stuff...) pr_warning("udc: " stuff) |
181 | #define INFO(stuff...) printk(KERN_INFO "udc: " stuff) | 175 | #define INFO(stuff...) pr_info("udc: " stuff) |
176 | #define DBG(stuff...) pr_debug("udc: " stuff) | ||
182 | 177 | ||
183 | #endif | 178 | #endif |
184 | 179 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 4fb5ff469574..af8b2a3a2d4a 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -1384,8 +1384,7 @@ delegate: | |||
1384 | return retval; | 1384 | return retval; |
1385 | 1385 | ||
1386 | stall: | 1386 | stall: |
1387 | printk(KERN_ERR | 1387 | pr_err("udc: %s: Invalid setup request: %02x.%02x v%04x i%04x l%d, " |
1388 | "udc: %s: Invalid setup request: %02x.%02x v%04x i%04x l%d, " | ||
1389 | "halting endpoint...\n", | 1388 | "halting endpoint...\n", |
1390 | ep->ep.name, crq->bRequestType, crq->bRequest, | 1389 | ep->ep.name, crq->bRequestType, crq->bRequest, |
1391 | le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), | 1390 | le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), |
@@ -1456,8 +1455,7 @@ restart: | |||
1456 | set_protocol_stall(udc, ep); | 1455 | set_protocol_stall(udc, ep); |
1457 | break; | 1456 | break; |
1458 | default: | 1457 | default: |
1459 | printk(KERN_ERR | 1458 | pr_err("udc: %s: TXCOMP: Invalid endpoint state %d, " |
1460 | "udc: %s: TXCOMP: Invalid endpoint state %d, " | ||
1461 | "halting endpoint...\n", | 1459 | "halting endpoint...\n", |
1462 | ep->ep.name, ep->state); | 1460 | ep->ep.name, ep->state); |
1463 | set_protocol_stall(udc, ep); | 1461 | set_protocol_stall(udc, ep); |
@@ -1486,8 +1484,7 @@ restart: | |||
1486 | default: | 1484 | default: |
1487 | usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY); | 1485 | usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY); |
1488 | usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY); | 1486 | usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY); |
1489 | printk(KERN_ERR | 1487 | pr_err("udc: %s: RXRDY: Invalid endpoint state %d, " |
1490 | "udc: %s: RXRDY: Invalid endpoint state %d, " | ||
1491 | "halting endpoint...\n", | 1488 | "halting endpoint...\n", |
1492 | ep->ep.name, ep->state); | 1489 | ep->ep.name, ep->state); |
1493 | set_protocol_stall(udc, ep); | 1490 | set_protocol_stall(udc, ep); |
@@ -1532,7 +1529,7 @@ restart: | |||
1532 | pkt_len = USBA_BFEXT(BYTE_COUNT, usba_ep_readl(ep, STA)); | 1529 | pkt_len = USBA_BFEXT(BYTE_COUNT, usba_ep_readl(ep, STA)); |
1533 | DBG(DBG_HW, "Packet length: %u\n", pkt_len); | 1530 | DBG(DBG_HW, "Packet length: %u\n", pkt_len); |
1534 | if (pkt_len != sizeof(crq)) { | 1531 | if (pkt_len != sizeof(crq)) { |
1535 | printk(KERN_WARNING "udc: Invalid packet length %u " | 1532 | pr_warning("udc: Invalid packet length %u " |
1536 | "(expected %lu)\n", pkt_len, sizeof(crq)); | 1533 | "(expected %lu)\n", pkt_len, sizeof(crq)); |
1537 | set_protocol_stall(udc, ep); | 1534 | set_protocol_stall(udc, ep); |
1538 | return; | 1535 | return; |
diff --git a/drivers/usb/gadget/atmel_usba_udc.h b/drivers/usb/gadget/atmel_usba_udc.h index a68304e31a68..08bf6f9aaf7e 100644 --- a/drivers/usb/gadget/atmel_usba_udc.h +++ b/drivers/usb/gadget/atmel_usba_udc.h | |||
@@ -216,7 +216,6 @@ | |||
216 | #define FIFO_IOMEM_ID 0 | 216 | #define FIFO_IOMEM_ID 0 |
217 | #define CTRL_IOMEM_ID 1 | 217 | #define CTRL_IOMEM_ID 1 |
218 | 218 | ||
219 | #ifdef DEBUG | ||
220 | #define DBG_ERR 0x0001 /* report all error returns */ | 219 | #define DBG_ERR 0x0001 /* report all error returns */ |
221 | #define DBG_HW 0x0002 /* debug hardware initialization */ | 220 | #define DBG_HW 0x0002 /* debug hardware initialization */ |
222 | #define DBG_GADGET 0x0004 /* calls to/from gadget driver */ | 221 | #define DBG_GADGET 0x0004 /* calls to/from gadget driver */ |
@@ -230,14 +229,12 @@ | |||
230 | #define DBG_NONE 0x0000 | 229 | #define DBG_NONE 0x0000 |
231 | 230 | ||
232 | #define DEBUG_LEVEL (DBG_ERR) | 231 | #define DEBUG_LEVEL (DBG_ERR) |
232 | |||
233 | #define DBG(level, fmt, ...) \ | 233 | #define DBG(level, fmt, ...) \ |
234 | do { \ | 234 | do { \ |
235 | if ((level) & DEBUG_LEVEL) \ | 235 | if ((level) & DEBUG_LEVEL) \ |
236 | printk(KERN_DEBUG "udc: " fmt, ## __VA_ARGS__); \ | 236 | pr_debug("udc: " fmt, ## __VA_ARGS__); \ |
237 | } while (0) | 237 | } while (0) |
238 | #else | ||
239 | #define DBG(level, fmt...) | ||
240 | #endif | ||
241 | 238 | ||
242 | enum usba_ctrl_state { | 239 | enum usba_ctrl_state { |
243 | WAIT_FOR_SETUP, | 240 | WAIT_FOR_SETUP, |
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 1d174dcb3ac9..3301167d4f2a 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -275,19 +275,15 @@ MODULE_LICENSE("Dual BSD/GPL"); | |||
275 | 275 | ||
276 | /*-------------------------------------------------------------------------*/ | 276 | /*-------------------------------------------------------------------------*/ |
277 | 277 | ||
278 | #ifdef DEBUG | ||
279 | #define LDBG(lun,fmt,args...) \ | 278 | #define LDBG(lun,fmt,args...) \ |
280 | dev_dbg(&(lun)->dev , fmt , ## args) | 279 | dev_dbg(&(lun)->dev , fmt , ## args) |
281 | #define MDBG(fmt,args...) \ | 280 | #define MDBG(fmt,args...) \ |
282 | printk(KERN_DEBUG DRIVER_NAME ": " fmt , ## args) | 281 | pr_debug(DRIVER_NAME ": " fmt , ## args) |
283 | #else | 282 | |
284 | #define LDBG(lun,fmt,args...) \ | 283 | #ifndef DEBUG |
285 | do { } while (0) | ||
286 | #define MDBG(fmt,args...) \ | ||
287 | do { } while (0) | ||
288 | #undef VERBOSE_DEBUG | 284 | #undef VERBOSE_DEBUG |
289 | #undef DUMP_MSGS | 285 | #undef DUMP_MSGS |
290 | #endif /* DEBUG */ | 286 | #endif /* !DEBUG */ |
291 | 287 | ||
292 | #ifdef VERBOSE_DEBUG | 288 | #ifdef VERBOSE_DEBUG |
293 | #define VLDBG LDBG | 289 | #define VLDBG LDBG |
@@ -304,7 +300,7 @@ MODULE_LICENSE("Dual BSD/GPL"); | |||
304 | dev_info(&(lun)->dev , fmt , ## args) | 300 | dev_info(&(lun)->dev , fmt , ## args) |
305 | 301 | ||
306 | #define MINFO(fmt,args...) \ | 302 | #define MINFO(fmt,args...) \ |
307 | printk(KERN_INFO DRIVER_NAME ": " fmt , ## args) | 303 | pr_info(DRIVER_NAME ": " fmt , ## args) |
308 | 304 | ||
309 | #define DBG(d, fmt, args...) \ | 305 | #define DBG(d, fmt, args...) \ |
310 | dev_dbg(&(d)->gadget->dev , fmt , ## args) | 306 | dev_dbg(&(d)->gadget->dev , fmt , ## args) |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index 832ab82b4882..9fb0b1ec8526 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h | |||
@@ -551,9 +551,9 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length) | |||
551 | #define VDBG(stuff...) do{}while(0) | 551 | #define VDBG(stuff...) do{}while(0) |
552 | #endif | 552 | #endif |
553 | 553 | ||
554 | #define ERR(stuff...) printk(KERN_ERR "udc: " stuff) | 554 | #define ERR(stuff...) pr_err("udc: " stuff) |
555 | #define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) | 555 | #define WARN(stuff...) pr_warning("udc: " stuff) |
556 | #define INFO(stuff...) printk(KERN_INFO "udc: " stuff) | 556 | #define INFO(stuff...) pr_info("udc: " stuff) |
557 | 557 | ||
558 | /*-------------------------------------------------------------------------*/ | 558 | /*-------------------------------------------------------------------------*/ |
559 | 559 | ||
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 7da7fcb05640..5b42ccd0035f 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -1158,7 +1158,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget) | |||
1158 | /* support optional vendor/distro customization */ | 1158 | /* support optional vendor/distro customization */ |
1159 | if (idVendor) { | 1159 | if (idVendor) { |
1160 | if (!idProduct) { | 1160 | if (!idProduct) { |
1161 | printk(KERN_ERR "idVendor needs idProduct!\n"); | 1161 | pr_err("idVendor needs idProduct!\n"); |
1162 | return -ENODEV; | 1162 | return -ENODEV; |
1163 | } | 1163 | } |
1164 | device_desc.idVendor = cpu_to_le16(idVendor); | 1164 | device_desc.idVendor = cpu_to_le16(idVendor); |
@@ -1190,7 +1190,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget) | |||
1190 | in_ep = usb_ep_autoconfig(gadget, &bulk_in_desc); | 1190 | in_ep = usb_ep_autoconfig(gadget, &bulk_in_desc); |
1191 | if (!in_ep) { | 1191 | if (!in_ep) { |
1192 | autoconf_fail: | 1192 | autoconf_fail: |
1193 | printk(KERN_ERR "%s: can't autoconfigure on %s\n", | 1193 | pr_err("%s: can't autoconfigure on %s\n", |
1194 | shortname, gadget->name); | 1194 | shortname, gadget->name); |
1195 | return -ENODEV; | 1195 | return -ENODEV; |
1196 | } | 1196 | } |
@@ -1212,7 +1212,7 @@ autoconf_fail: | |||
1212 | * it SHOULD NOT have problems with bulk-capable hardware. | 1212 | * it SHOULD NOT have problems with bulk-capable hardware. |
1213 | * so warn about unrecognized controllers, don't panic. | 1213 | * so warn about unrecognized controllers, don't panic. |
1214 | */ | 1214 | */ |
1215 | printk(KERN_WARNING "%s: controller '%s' not recognized\n", | 1215 | pr_warning("%s: controller '%s' not recognized\n", |
1216 | shortname, gadget->name); | 1216 | shortname, gadget->name); |
1217 | device_desc.bcdDevice = __constant_cpu_to_le16(0x9999); | 1217 | device_desc.bcdDevice = __constant_cpu_to_le16(0x9999); |
1218 | } | 1218 | } |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index 47ef8bd58a00..805602a687cb 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -1699,7 +1699,7 @@ gadgetfs_bind (struct usb_gadget *gadget) | |||
1699 | if (!dev) | 1699 | if (!dev) |
1700 | return -ESRCH; | 1700 | return -ESRCH; |
1701 | if (0 != strcmp (CHIP, gadget->name)) { | 1701 | if (0 != strcmp (CHIP, gadget->name)) { |
1702 | printk (KERN_ERR "%s expected %s controller not %s\n", | 1702 | pr_err("%s expected %s controller not %s\n", |
1703 | shortname, CHIP, gadget->name); | 1703 | shortname, CHIP, gadget->name); |
1704 | return -ENODEV; | 1704 | return -ENODEV; |
1705 | } | 1705 | } |
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index 478d8349cf00..43f02189dc44 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -147,7 +147,7 @@ static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum) | |||
147 | offset = get_pipectr_addr(pipenum); | 147 | offset = get_pipectr_addr(pipenum); |
148 | pid = m66592_read(m66592, offset) & M66592_PID; | 148 | pid = m66592_read(m66592, offset) & M66592_PID; |
149 | } else | 149 | } else |
150 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 150 | pr_err("unexpect pipe num (%d)\n", pipenum); |
151 | 151 | ||
152 | return pid; | 152 | return pid; |
153 | } | 153 | } |
@@ -163,7 +163,7 @@ static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum, | |||
163 | offset = get_pipectr_addr(pipenum); | 163 | offset = get_pipectr_addr(pipenum); |
164 | m66592_mdfy(m66592, pid, M66592_PID, offset); | 164 | m66592_mdfy(m66592, pid, M66592_PID, offset); |
165 | } else | 165 | } else |
166 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 166 | pr_err("unexpect pipe num (%d)\n", pipenum); |
167 | } | 167 | } |
168 | 168 | ||
169 | static inline void pipe_start(struct m66592 *m66592, u16 pipenum) | 169 | static inline void pipe_start(struct m66592 *m66592, u16 pipenum) |
@@ -192,7 +192,7 @@ static inline u16 control_reg_get(struct m66592 *m66592, u16 pipenum) | |||
192 | offset = get_pipectr_addr(pipenum); | 192 | offset = get_pipectr_addr(pipenum); |
193 | ret = m66592_read(m66592, offset); | 193 | ret = m66592_read(m66592, offset); |
194 | } else | 194 | } else |
195 | printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); | 195 | pr_err("unexpect pipe num (%d)\n", pipenum); |
196 | 196 | ||
197 | return ret; | 197 | return ret; |
198 | } | 198 | } |
@@ -209,7 +209,7 @@ static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum) | |||
209 | offset = get_pipectr_addr(pipenum); | 209 | offset = get_pipectr_addr(pipenum); |
210 | m66592_bset(m66592, M66592_SQCLR, offset); | 210 | m66592_bset(m66592, M66592_SQCLR, offset); |
211 | } else | 211 | } else |
212 | printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum); | 212 | pr_err("unexpect pipe num(%d)\n", pipenum); |
213 | } | 213 | } |
214 | 214 | ||
215 | static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) | 215 | static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) |
@@ -291,7 +291,7 @@ static int pipe_buffer_setting(struct m66592 *m66592, | |||
291 | break; | 291 | break; |
292 | } | 292 | } |
293 | if (m66592->bi_bufnum > M66592_MAX_BUFNUM) { | 293 | if (m66592->bi_bufnum > M66592_MAX_BUFNUM) { |
294 | printk(KERN_ERR "m66592 pipe memory is insufficient(%d)\n", | 294 | pr_err("m66592 pipe memory is insufficient(%d)\n", |
295 | m66592->bi_bufnum); | 295 | m66592->bi_bufnum); |
296 | return -ENOMEM; | 296 | return -ENOMEM; |
297 | } | 297 | } |
@@ -332,7 +332,7 @@ static void pipe_buffer_release(struct m66592 *m66592, | |||
332 | if (info->type == M66592_BULK) | 332 | if (info->type == M66592_BULK) |
333 | m66592->bulk--; | 333 | m66592->bulk--; |
334 | } else | 334 | } else |
335 | printk(KERN_ERR "ep_release: unexpect pipenum (%d)\n", | 335 | pr_err("ep_release: unexpect pipenum (%d)\n", |
336 | info->pipe); | 336 | info->pipe); |
337 | } | 337 | } |
338 | 338 | ||
@@ -430,7 +430,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
430 | case USB_ENDPOINT_XFER_BULK: | 430 | case USB_ENDPOINT_XFER_BULK: |
431 | if (m66592->bulk >= M66592_MAX_NUM_BULK) { | 431 | if (m66592->bulk >= M66592_MAX_NUM_BULK) { |
432 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { | 432 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { |
433 | printk(KERN_ERR "bulk pipe is insufficient\n"); | 433 | pr_err("bulk pipe is insufficient\n"); |
434 | return -ENODEV; | 434 | return -ENODEV; |
435 | } else { | 435 | } else { |
436 | info.pipe = M66592_BASE_PIPENUM_ISOC | 436 | info.pipe = M66592_BASE_PIPENUM_ISOC |
@@ -446,7 +446,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
446 | break; | 446 | break; |
447 | case USB_ENDPOINT_XFER_INT: | 447 | case USB_ENDPOINT_XFER_INT: |
448 | if (m66592->interrupt >= M66592_MAX_NUM_INT) { | 448 | if (m66592->interrupt >= M66592_MAX_NUM_INT) { |
449 | printk(KERN_ERR "interrupt pipe is insufficient\n"); | 449 | pr_err("interrupt pipe is insufficient\n"); |
450 | return -ENODEV; | 450 | return -ENODEV; |
451 | } | 451 | } |
452 | info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt; | 452 | info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt; |
@@ -455,7 +455,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
455 | break; | 455 | break; |
456 | case USB_ENDPOINT_XFER_ISOC: | 456 | case USB_ENDPOINT_XFER_ISOC: |
457 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { | 457 | if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { |
458 | printk(KERN_ERR "isochronous pipe is insufficient\n"); | 458 | pr_err("isochronous pipe is insufficient\n"); |
459 | return -ENODEV; | 459 | return -ENODEV; |
460 | } | 460 | } |
461 | info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous; | 461 | info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous; |
@@ -463,7 +463,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
463 | counter = &m66592->isochronous; | 463 | counter = &m66592->isochronous; |
464 | break; | 464 | break; |
465 | default: | 465 | default: |
466 | printk(KERN_ERR "unexpect xfer type\n"); | 466 | pr_err("unexpect xfer type\n"); |
467 | return -EINVAL; | 467 | return -EINVAL; |
468 | } | 468 | } |
469 | ep->type = info.type; | 469 | ep->type = info.type; |
@@ -478,7 +478,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, | |||
478 | 478 | ||
479 | ret = pipe_buffer_setting(m66592, &info); | 479 | ret = pipe_buffer_setting(m66592, &info); |
480 | if (ret < 0) { | 480 | if (ret < 0) { |
481 | printk(KERN_ERR "pipe_buffer_setting fail\n"); | 481 | pr_err("pipe_buffer_setting fail\n"); |
482 | return ret; | 482 | return ret; |
483 | } | 483 | } |
484 | 484 | ||
@@ -614,7 +614,7 @@ static void start_ep0(struct m66592_ep *ep, struct m66592_request *req) | |||
614 | control_end(ep->m66592, 0); | 614 | control_end(ep->m66592, 0); |
615 | break; | 615 | break; |
616 | default: | 616 | default: |
617 | printk(KERN_ERR "start_ep0: unexpect ctsq(%x)\n", ctsq); | 617 | pr_err("start_ep0: unexpect ctsq(%x)\n", ctsq); |
618 | break; | 618 | break; |
619 | } | 619 | } |
620 | } | 620 | } |
@@ -748,7 +748,7 @@ static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req) | |||
748 | do { | 748 | do { |
749 | tmp = m66592_read(m66592, ep->fifoctr); | 749 | tmp = m66592_read(m66592, ep->fifoctr); |
750 | if (i++ > 100000) { | 750 | if (i++ > 100000) { |
751 | printk(KERN_ERR "pipe0 is busy. maybe cpu i/o bus " | 751 | pr_err("pipe0 is busy. maybe cpu i/o bus " |
752 | "conflict. please power off this controller."); | 752 | "conflict. please power off this controller."); |
753 | return; | 753 | return; |
754 | } | 754 | } |
@@ -798,7 +798,7 @@ static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req) | |||
798 | if (unlikely((tmp & M66592_FRDY) == 0)) { | 798 | if (unlikely((tmp & M66592_FRDY) == 0)) { |
799 | pipe_stop(m66592, pipenum); | 799 | pipe_stop(m66592, pipenum); |
800 | pipe_irq_disable(m66592, pipenum); | 800 | pipe_irq_disable(m66592, pipenum); |
801 | printk(KERN_ERR "write fifo not ready. pipnum=%d\n", pipenum); | 801 | pr_err("write fifo not ready. pipnum=%d\n", pipenum); |
802 | return; | 802 | return; |
803 | } | 803 | } |
804 | 804 | ||
@@ -847,7 +847,7 @@ static void irq_packet_read(struct m66592_ep *ep, struct m66592_request *req) | |||
847 | req->req.status = -EPIPE; | 847 | req->req.status = -EPIPE; |
848 | pipe_stop(m66592, pipenum); | 848 | pipe_stop(m66592, pipenum); |
849 | pipe_irq_disable(m66592, pipenum); | 849 | pipe_irq_disable(m66592, pipenum); |
850 | printk(KERN_ERR "read fifo not ready"); | 850 | pr_err("read fifo not ready"); |
851 | return; | 851 | return; |
852 | } | 852 | } |
853 | 853 | ||
@@ -1102,7 +1102,7 @@ static void m66592_update_usb_speed(struct m66592 *m66592) | |||
1102 | break; | 1102 | break; |
1103 | default: | 1103 | default: |
1104 | m66592->gadget.speed = USB_SPEED_UNKNOWN; | 1104 | m66592->gadget.speed = USB_SPEED_UNKNOWN; |
1105 | printk(KERN_ERR "USB speed unknown\n"); | 1105 | pr_err("USB speed unknown\n"); |
1106 | } | 1106 | } |
1107 | } | 1107 | } |
1108 | 1108 | ||
@@ -1161,7 +1161,7 @@ __acquires(m66592->lock) | |||
1161 | control_end(m66592, 0); | 1161 | control_end(m66592, 0); |
1162 | break; | 1162 | break; |
1163 | default: | 1163 | default: |
1164 | printk(KERN_ERR "ctrl_stage: unexpect ctsq(%x)\n", ctsq); | 1164 | pr_err("ctrl_stage: unexpect ctsq(%x)\n", ctsq); |
1165 | break; | 1165 | break; |
1166 | } | 1166 | } |
1167 | } | 1167 | } |
@@ -1461,13 +1461,13 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1461 | 1461 | ||
1462 | retval = device_add(&m66592->gadget.dev); | 1462 | retval = device_add(&m66592->gadget.dev); |
1463 | if (retval) { | 1463 | if (retval) { |
1464 | printk(KERN_ERR "device_add error (%d)\n", retval); | 1464 | pr_err("device_add error (%d)\n", retval); |
1465 | goto error; | 1465 | goto error; |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | retval = driver->bind (&m66592->gadget); | 1468 | retval = driver->bind (&m66592->gadget); |
1469 | if (retval) { | 1469 | if (retval) { |
1470 | printk(KERN_ERR "bind to driver error (%d)\n", retval); | 1470 | pr_err("bind to driver error (%d)\n", retval); |
1471 | device_del(&m66592->gadget.dev); | 1471 | device_del(&m66592->gadget.dev); |
1472 | goto error; | 1472 | goto error; |
1473 | } | 1473 | } |
@@ -1561,28 +1561,28 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1561 | (char *)udc_name); | 1561 | (char *)udc_name); |
1562 | if (!res) { | 1562 | if (!res) { |
1563 | ret = -ENODEV; | 1563 | ret = -ENODEV; |
1564 | printk(KERN_ERR "platform_get_resource_byname error.\n"); | 1564 | pr_err("platform_get_resource_byname error.\n"); |
1565 | goto clean_up; | 1565 | goto clean_up; |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | irq = platform_get_irq(pdev, 0); | 1568 | irq = platform_get_irq(pdev, 0); |
1569 | if (irq < 0) { | 1569 | if (irq < 0) { |
1570 | ret = -ENODEV; | 1570 | ret = -ENODEV; |
1571 | printk(KERN_ERR "platform_get_irq error.\n"); | 1571 | pr_err("platform_get_irq error.\n"); |
1572 | goto clean_up; | 1572 | goto clean_up; |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | reg = ioremap(res->start, resource_len(res)); | 1575 | reg = ioremap(res->start, resource_len(res)); |
1576 | if (reg == NULL) { | 1576 | if (reg == NULL) { |
1577 | ret = -ENOMEM; | 1577 | ret = -ENOMEM; |
1578 | printk(KERN_ERR "ioremap error.\n"); | 1578 | pr_err("ioremap error.\n"); |
1579 | goto clean_up; | 1579 | goto clean_up; |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | /* initialize ucd */ | 1582 | /* initialize ucd */ |
1583 | m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); | 1583 | m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); |
1584 | if (m66592 == NULL) { | 1584 | if (m66592 == NULL) { |
1585 | printk(KERN_ERR "kzalloc error\n"); | 1585 | pr_err("kzalloc error\n"); |
1586 | goto clean_up; | 1586 | goto clean_up; |
1587 | } | 1587 | } |
1588 | 1588 | ||
@@ -1608,7 +1608,7 @@ static int __init m66592_probe(struct platform_device *pdev) | |||
1608 | ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED, | 1608 | ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED, |
1609 | udc_name, m66592); | 1609 | udc_name, m66592); |
1610 | if (ret < 0) { | 1610 | if (ret < 0) { |
1611 | printk(KERN_ERR "request_irq error (%d)\n", ret); | 1611 | pr_err("request_irq error (%d)\n", ret); |
1612 | goto clean_up; | 1612 | goto clean_up; |
1613 | } | 1613 | } |
1614 | 1614 | ||
diff --git a/drivers/usb/gadget/omap_udc.h b/drivers/usb/gadget/omap_udc.h index 1dc398bb9ab2..c6b9cbc7230a 100644 --- a/drivers/usb/gadget/omap_udc.h +++ b/drivers/usb/gadget/omap_udc.h | |||
@@ -182,21 +182,16 @@ struct omap_udc { | |||
182 | 182 | ||
183 | /*-------------------------------------------------------------------------*/ | 183 | /*-------------------------------------------------------------------------*/ |
184 | 184 | ||
185 | #ifdef DEBUG | ||
186 | #define DBG(stuff...) printk(KERN_DEBUG "udc: " stuff) | ||
187 | #else | ||
188 | #define DBG(stuff...) do{}while(0) | ||
189 | #endif | ||
190 | |||
191 | #ifdef VERBOSE | 185 | #ifdef VERBOSE |
192 | # define VDBG DBG | 186 | # define VDBG DBG |
193 | #else | 187 | #else |
194 | # define VDBG(stuff...) do{}while(0) | 188 | # define VDBG(stuff...) do{}while(0) |
195 | #endif | 189 | #endif |
196 | 190 | ||
197 | #define ERR(stuff...) printk(KERN_ERR "udc: " stuff) | 191 | #define ERR(stuff...) pr_err("udc: " stuff) |
198 | #define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) | 192 | #define WARN(stuff...) pr_warning("udc: " stuff) |
199 | #define INFO(stuff...) printk(KERN_INFO "udc: " stuff) | 193 | #define INFO(stuff...) pr_info("udc: " stuff) |
194 | #define DBG(stuff...) pr_debug("udc: " stuff) | ||
200 | 195 | ||
201 | /*-------------------------------------------------------------------------*/ | 196 | /*-------------------------------------------------------------------------*/ |
202 | 197 | ||
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 3173b39f0bfd..8c139d416ac4 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c | |||
@@ -2099,7 +2099,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) | |||
2099 | /* insist on Intel/ARM/XScale */ | 2099 | /* insist on Intel/ARM/XScale */ |
2100 | asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); | 2100 | asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); |
2101 | if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { | 2101 | if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { |
2102 | printk(KERN_ERR "%s: not XScale!\n", driver_name); | 2102 | pr_err("%s: not XScale!\n", driver_name); |
2103 | return -ENODEV; | 2103 | return -ENODEV; |
2104 | } | 2104 | } |
2105 | 2105 | ||
@@ -2128,7 +2128,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) | |||
2128 | break; | 2128 | break; |
2129 | #endif | 2129 | #endif |
2130 | default: | 2130 | default: |
2131 | printk(KERN_ERR "%s: unrecognized processor: %08x\n", | 2131 | pr_err("%s: unrecognized processor: %08x\n", |
2132 | driver_name, chiprev); | 2132 | driver_name, chiprev); |
2133 | /* iop3xx, ixp4xx, ... */ | 2133 | /* iop3xx, ixp4xx, ... */ |
2134 | return -ENODEV; | 2134 | return -ENODEV; |
@@ -2199,7 +2199,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) | |||
2199 | retval = request_irq(irq, pxa2xx_udc_irq, | 2199 | retval = request_irq(irq, pxa2xx_udc_irq, |
2200 | IRQF_DISABLED, driver_name, dev); | 2200 | IRQF_DISABLED, driver_name, dev); |
2201 | if (retval != 0) { | 2201 | if (retval != 0) { |
2202 | printk(KERN_ERR "%s: can't get irq %d, err %d\n", | 2202 | pr_err("%s: can't get irq %d, err %d\n", |
2203 | driver_name, irq, retval); | 2203 | driver_name, irq, retval); |
2204 | goto err_irq1; | 2204 | goto err_irq1; |
2205 | } | 2205 | } |
@@ -2212,7 +2212,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) | |||
2212 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, | 2212 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, |
2213 | driver_name, dev); | 2213 | driver_name, dev); |
2214 | if (retval != 0) { | 2214 | if (retval != 0) { |
2215 | printk(KERN_ERR "%s: can't get irq %i, err %d\n", | 2215 | pr_err("%s: can't get irq %i, err %d\n", |
2216 | driver_name, LUBBOCK_USB_DISC_IRQ, retval); | 2216 | driver_name, LUBBOCK_USB_DISC_IRQ, retval); |
2217 | lubbock_fail0: | 2217 | lubbock_fail0: |
2218 | goto err_irq_lub; | 2218 | goto err_irq_lub; |
@@ -2222,7 +2222,7 @@ lubbock_fail0: | |||
2222 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, | 2222 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, |
2223 | driver_name, dev); | 2223 | driver_name, dev); |
2224 | if (retval != 0) { | 2224 | if (retval != 0) { |
2225 | printk(KERN_ERR "%s: can't get irq %i, err %d\n", | 2225 | pr_err("%s: can't get irq %i, err %d\n", |
2226 | driver_name, LUBBOCK_USB_IRQ, retval); | 2226 | driver_name, LUBBOCK_USB_IRQ, retval); |
2227 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); | 2227 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); |
2228 | goto lubbock_fail0; | 2228 | goto lubbock_fail0; |
@@ -2235,7 +2235,7 @@ lubbock_fail0: | |||
2235 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 2235 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
2236 | driver_name, dev); | 2236 | driver_name, dev); |
2237 | if (retval != 0) { | 2237 | if (retval != 0) { |
2238 | printk(KERN_ERR "%s: can't get irq %i, err %d\n", | 2238 | pr_err("%s: can't get irq %i, err %d\n", |
2239 | driver_name, vbus_irq, retval); | 2239 | driver_name, vbus_irq, retval); |
2240 | goto err_vbus_irq; | 2240 | goto err_vbus_irq; |
2241 | } | 2241 | } |
@@ -2361,7 +2361,7 @@ static struct platform_driver udc_driver = { | |||
2361 | 2361 | ||
2362 | static int __init udc_init(void) | 2362 | static int __init udc_init(void) |
2363 | { | 2363 | { |
2364 | printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); | 2364 | pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); |
2365 | return platform_driver_probe(&udc_driver, pxa2xx_udc_probe); | 2365 | return platform_driver_probe(&udc_driver, pxa2xx_udc_probe); |
2366 | } | 2366 | } |
2367 | module_init(udc_init); | 2367 | module_init(udc_init); |
diff --git a/drivers/usb/gadget/pxa2xx_udc.h b/drivers/usb/gadget/pxa2xx_udc.h index 1db46d705777..97a8c45ccd81 100644 --- a/drivers/usb/gadget/pxa2xx_udc.h +++ b/drivers/usb/gadget/pxa2xx_udc.h | |||
@@ -151,6 +151,8 @@ static struct pxa2xx_udc *the_controller; | |||
151 | #define DBG_NOISY 3 /* ... even more: request level */ | 151 | #define DBG_NOISY 3 /* ... even more: request level */ |
152 | #define DBG_VERY_NOISY 4 /* ... even more: packet level */ | 152 | #define DBG_VERY_NOISY 4 /* ... even more: packet level */ |
153 | 153 | ||
154 | #define DMSG(stuff...) pr_debug("udc: " stuff) | ||
155 | |||
154 | #ifdef DEBUG | 156 | #ifdef DEBUG |
155 | 157 | ||
156 | static const char *state_name[] = { | 158 | static const char *state_name[] = { |
@@ -159,8 +161,6 @@ static const char *state_name[] = { | |||
159 | "EP0_END_XFER", "EP0_STALL" | 161 | "EP0_END_XFER", "EP0_STALL" |
160 | }; | 162 | }; |
161 | 163 | ||
162 | #define DMSG(stuff...) printk(KERN_DEBUG "udc: " stuff) | ||
163 | |||
164 | #ifdef VERBOSE | 164 | #ifdef VERBOSE |
165 | # define UDC_DEBUG DBG_VERBOSE | 165 | # define UDC_DEBUG DBG_VERBOSE |
166 | #else | 166 | #else |
@@ -241,8 +241,6 @@ dump_state(struct pxa2xx_udc *dev) | |||
241 | 241 | ||
242 | #else | 242 | #else |
243 | 243 | ||
244 | #define DMSG(stuff...) do{}while(0) | ||
245 | |||
246 | #define dump_udccr(x) do{}while(0) | 244 | #define dump_udccr(x) do{}while(0) |
247 | #define dump_udccs0(x) do{}while(0) | 245 | #define dump_udccs0(x) do{}while(0) |
248 | #define dump_state(x) do{}while(0) | 246 | #define dump_state(x) do{}while(0) |
@@ -253,8 +251,9 @@ dump_state(struct pxa2xx_udc *dev) | |||
253 | 251 | ||
254 | #define DBG(lvl, stuff...) do{if ((lvl) <= UDC_DEBUG) DMSG(stuff);}while(0) | 252 | #define DBG(lvl, stuff...) do{if ((lvl) <= UDC_DEBUG) DMSG(stuff);}while(0) |
255 | 253 | ||
256 | #define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) | 254 | #define ERR(stuff...) pr_err("udc: " stuff) |
257 | #define INFO(stuff...) printk(KERN_INFO "udc: " stuff) | 255 | #define WARN(stuff...) pr_warning("udc: " stuff) |
256 | #define INFO(stuff...) pr_info("udc: " stuff) | ||
258 | 257 | ||
259 | 258 | ||
260 | #endif /* __LINUX_USB_GADGET_PXA2XX_H */ | 259 | #endif /* __LINUX_USB_GADGET_PXA2XX_H */ |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index db1b2bfcee4e..3d036647431f 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -53,21 +53,18 @@ | |||
53 | */ | 53 | */ |
54 | 54 | ||
55 | #if 0 | 55 | #if 0 |
56 | #define DBG(str,args...) do { \ | ||
57 | if (rndis_debug) \ | ||
58 | printk(KERN_DEBUG str , ## args ); \ | ||
59 | } while (0) | ||
60 | static int rndis_debug = 0; | 56 | static int rndis_debug = 0; |
61 | |||
62 | module_param (rndis_debug, int, 0); | 57 | module_param (rndis_debug, int, 0); |
63 | MODULE_PARM_DESC (rndis_debug, "enable debugging"); | 58 | MODULE_PARM_DESC (rndis_debug, "enable debugging"); |
64 | |||
65 | #else | 59 | #else |
66 | |||
67 | #define rndis_debug 0 | 60 | #define rndis_debug 0 |
68 | #define DBG(str,args...) do{}while(0) | ||
69 | #endif | 61 | #endif |
70 | 62 | ||
63 | #define DBG(str,args...) do { \ | ||
64 | if (rndis_debug) \ | ||
65 | pr_debug(str , ## args); \ | ||
66 | } while (0) | ||
67 | |||
71 | #define RNDIS_MAX_CONFIGS 1 | 68 | #define RNDIS_MAX_CONFIGS 1 |
72 | 69 | ||
73 | 70 | ||
@@ -679,7 +676,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, | |||
679 | #endif | 676 | #endif |
680 | 677 | ||
681 | default: | 678 | default: |
682 | printk (KERN_WARNING "%s: query unknown OID 0x%08X\n", | 679 | pr_warning("%s: query unknown OID 0x%08X\n", |
683 | __FUNCTION__, OID); | 680 | __FUNCTION__, OID); |
684 | } | 681 | } |
685 | if (retval < 0) | 682 | if (retval < 0) |
@@ -804,7 +801,7 @@ update_linkstate: | |||
804 | #endif /* RNDIS_PM */ | 801 | #endif /* RNDIS_PM */ |
805 | 802 | ||
806 | default: | 803 | default: |
807 | printk (KERN_WARNING "%s: set unknown OID 0x%08X, size %d\n", | 804 | pr_warning("%s: set unknown OID 0x%08X, size %d\n", |
808 | __FUNCTION__, OID, buf_len); | 805 | __FUNCTION__, OID, buf_len); |
809 | } | 806 | } |
810 | 807 | ||
@@ -1126,8 +1123,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf) | |||
1126 | * In one case those messages seemed to relate to the host | 1123 | * In one case those messages seemed to relate to the host |
1127 | * suspending itself. | 1124 | * suspending itself. |
1128 | */ | 1125 | */ |
1129 | printk (KERN_WARNING | 1126 | pr_warning("%s: unknown RNDIS message 0x%08X len %d\n", |
1130 | "%s: unknown RNDIS message 0x%08X len %d\n", | ||
1131 | __FUNCTION__ , MsgType, MsgLength); | 1127 | __FUNCTION__ , MsgType, MsgLength); |
1132 | { | 1128 | { |
1133 | unsigned i; | 1129 | unsigned i; |
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index f5738eb8e765..f5c3896b1d95 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c | |||
@@ -89,9 +89,9 @@ static int debug = 1; | |||
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | #define gs_debug(format, arg...) \ | 91 | #define gs_debug(format, arg...) \ |
92 | do { if (debug) printk(KERN_DEBUG format, ## arg); } while(0) | 92 | do { if (debug) pr_debug(format, ## arg); } while (0) |
93 | #define gs_debug_level(level, format, arg...) \ | 93 | #define gs_debug_level(level, format, arg...) \ |
94 | do { if (debug>=level) printk(KERN_DEBUG format, ## arg); } while(0) | 94 | do { if (debug >= level) pr_debug(format, ## arg); } while (0) |
95 | 95 | ||
96 | 96 | ||
97 | /* Thanks to NetChip Technologies for donating this product ID. | 97 | /* Thanks to NetChip Technologies for donating this product ID. |
@@ -553,7 +553,8 @@ static int __init gs_module_init(void) | |||
553 | 553 | ||
554 | retval = usb_gadget_register_driver(&gs_gadget_driver); | 554 | retval = usb_gadget_register_driver(&gs_gadget_driver); |
555 | if (retval) { | 555 | if (retval) { |
556 | printk(KERN_ERR "gs_module_init: cannot register gadget driver, ret=%d\n", retval); | 556 | pr_err("gs_module_init: cannot register gadget driver, " |
557 | "ret=%d\n", retval); | ||
557 | return retval; | 558 | return retval; |
558 | } | 559 | } |
559 | 560 | ||
@@ -579,11 +580,13 @@ static int __init gs_module_init(void) | |||
579 | if (retval) { | 580 | if (retval) { |
580 | usb_gadget_unregister_driver(&gs_gadget_driver); | 581 | usb_gadget_unregister_driver(&gs_gadget_driver); |
581 | put_tty_driver(gs_tty_driver); | 582 | put_tty_driver(gs_tty_driver); |
582 | printk(KERN_ERR "gs_module_init: cannot register tty driver, ret=%d\n", retval); | 583 | pr_err("gs_module_init: cannot register tty driver, " |
584 | "ret=%d\n", retval); | ||
583 | return retval; | 585 | return retval; |
584 | } | 586 | } |
585 | 587 | ||
586 | printk(KERN_INFO "gs_module_init: %s %s loaded\n", GS_LONG_NAME, GS_VERSION_STR); | 588 | pr_info("gs_module_init: %s %s loaded\n", |
589 | GS_LONG_NAME, GS_VERSION_STR); | ||
587 | return 0; | 590 | return 0; |
588 | } | 591 | } |
589 | 592 | ||
@@ -598,7 +601,8 @@ static void __exit gs_module_exit(void) | |||
598 | put_tty_driver(gs_tty_driver); | 601 | put_tty_driver(gs_tty_driver); |
599 | usb_gadget_unregister_driver(&gs_gadget_driver); | 602 | usb_gadget_unregister_driver(&gs_gadget_driver); |
600 | 603 | ||
601 | printk(KERN_INFO "gs_module_exit: %s %s unloaded\n", GS_LONG_NAME, GS_VERSION_STR); | 604 | pr_info("gs_module_exit: %s %s unloaded\n", |
605 | GS_LONG_NAME, GS_VERSION_STR); | ||
602 | } | 606 | } |
603 | 607 | ||
604 | /* TTY Driver */ | 608 | /* TTY Driver */ |
@@ -621,7 +625,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
621 | gs_debug("gs_open: (%d,%p,%p)\n", port_num, tty, file); | 625 | gs_debug("gs_open: (%d,%p,%p)\n", port_num, tty, file); |
622 | 626 | ||
623 | if (port_num < 0 || port_num >= GS_NUM_PORTS) { | 627 | if (port_num < 0 || port_num >= GS_NUM_PORTS) { |
624 | printk(KERN_ERR "gs_open: (%d,%p,%p) invalid port number\n", | 628 | pr_err("gs_open: (%d,%p,%p) invalid port number\n", |
625 | port_num, tty, file); | 629 | port_num, tty, file); |
626 | return -ENODEV; | 630 | return -ENODEV; |
627 | } | 631 | } |
@@ -629,15 +633,14 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
629 | dev = gs_device; | 633 | dev = gs_device; |
630 | 634 | ||
631 | if (dev == NULL) { | 635 | if (dev == NULL) { |
632 | printk(KERN_ERR "gs_open: (%d,%p,%p) NULL device pointer\n", | 636 | pr_err("gs_open: (%d,%p,%p) NULL device pointer\n", |
633 | port_num, tty, file); | 637 | port_num, tty, file); |
634 | return -ENODEV; | 638 | return -ENODEV; |
635 | } | 639 | } |
636 | 640 | ||
637 | mtx = &gs_open_close_lock[port_num]; | 641 | mtx = &gs_open_close_lock[port_num]; |
638 | if (mutex_lock_interruptible(mtx)) { | 642 | if (mutex_lock_interruptible(mtx)) { |
639 | printk(KERN_ERR | 643 | pr_err("gs_open: (%d,%p,%p) interrupted waiting for mutex\n", |
640 | "gs_open: (%d,%p,%p) interrupted waiting for mutex\n", | ||
641 | port_num, tty, file); | 644 | port_num, tty, file); |
642 | return -ERESTARTSYS; | 645 | return -ERESTARTSYS; |
643 | } | 646 | } |
@@ -645,8 +648,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
645 | spin_lock_irqsave(&dev->dev_lock, flags); | 648 | spin_lock_irqsave(&dev->dev_lock, flags); |
646 | 649 | ||
647 | if (dev->dev_config == GS_NO_CONFIG_ID) { | 650 | if (dev->dev_config == GS_NO_CONFIG_ID) { |
648 | printk(KERN_ERR | 651 | pr_err("gs_open: (%d,%p,%p) device is not connected\n", |
649 | "gs_open: (%d,%p,%p) device is not connected\n", | ||
650 | port_num, tty, file); | 652 | port_num, tty, file); |
651 | ret = -ENODEV; | 653 | ret = -ENODEV; |
652 | goto exit_unlock_dev; | 654 | goto exit_unlock_dev; |
@@ -655,7 +657,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
655 | port = dev->dev_port[port_num]; | 657 | port = dev->dev_port[port_num]; |
656 | 658 | ||
657 | if (port == NULL) { | 659 | if (port == NULL) { |
658 | printk(KERN_ERR "gs_open: (%d,%p,%p) NULL port pointer\n", | 660 | pr_err("gs_open: (%d,%p,%p) NULL port pointer\n", |
659 | port_num, tty, file); | 661 | port_num, tty, file); |
660 | ret = -ENODEV; | 662 | ret = -ENODEV; |
661 | goto exit_unlock_dev; | 663 | goto exit_unlock_dev; |
@@ -665,7 +667,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
665 | spin_unlock(&dev->dev_lock); | 667 | spin_unlock(&dev->dev_lock); |
666 | 668 | ||
667 | if (port->port_dev == NULL) { | 669 | if (port->port_dev == NULL) { |
668 | printk(KERN_ERR "gs_open: (%d,%p,%p) port disconnected (1)\n", | 670 | pr_err("gs_open: (%d,%p,%p) port disconnected (1)\n", |
669 | port_num, tty, file); | 671 | port_num, tty, file); |
670 | ret = -EIO; | 672 | ret = -EIO; |
671 | goto exit_unlock_port; | 673 | goto exit_unlock_port; |
@@ -692,8 +694,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
692 | 694 | ||
693 | /* might have been disconnected while asleep, check */ | 695 | /* might have been disconnected while asleep, check */ |
694 | if (port->port_dev == NULL) { | 696 | if (port->port_dev == NULL) { |
695 | printk(KERN_ERR | 697 | pr_err("gs_open: (%d,%p,%p) port disconnected (2)\n", |
696 | "gs_open: (%d,%p,%p) port disconnected (2)\n", | ||
697 | port_num, tty, file); | 698 | port_num, tty, file); |
698 | port->port_in_use = 0; | 699 | port->port_in_use = 0; |
699 | ret = -EIO; | 700 | ret = -EIO; |
@@ -701,7 +702,8 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
701 | } | 702 | } |
702 | 703 | ||
703 | if ((port->port_write_buf=buf) == NULL) { | 704 | if ((port->port_write_buf=buf) == NULL) { |
704 | printk(KERN_ERR "gs_open: (%d,%p,%p) cannot allocate port write buffer\n", | 705 | pr_err("gs_open: (%d,%p,%p) cannot allocate " |
706 | "port write buffer\n", | ||
705 | port_num, tty, file); | 707 | port_num, tty, file); |
706 | port->port_in_use = 0; | 708 | port->port_in_use = 0; |
707 | ret = -ENOMEM; | 709 | ret = -ENOMEM; |
@@ -714,7 +716,7 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
714 | 716 | ||
715 | /* might have been disconnected while asleep, check */ | 717 | /* might have been disconnected while asleep, check */ |
716 | if (port->port_dev == NULL) { | 718 | if (port->port_dev == NULL) { |
717 | printk(KERN_ERR "gs_open: (%d,%p,%p) port disconnected (3)\n", | 719 | pr_err("gs_open: (%d,%p,%p) port disconnected (3)\n", |
718 | port_num, tty, file); | 720 | port_num, tty, file); |
719 | port->port_in_use = 0; | 721 | port->port_in_use = 0; |
720 | ret = -EIO; | 722 | ret = -EIO; |
@@ -762,7 +764,7 @@ static void gs_close(struct tty_struct *tty, struct file *file) | |||
762 | struct mutex *mtx; | 764 | struct mutex *mtx; |
763 | 765 | ||
764 | if (port == NULL) { | 766 | if (port == NULL) { |
765 | printk(KERN_ERR "gs_close: NULL port pointer\n"); | 767 | pr_err("gs_close: NULL port pointer\n"); |
766 | return; | 768 | return; |
767 | } | 769 | } |
768 | 770 | ||
@@ -774,8 +776,7 @@ static void gs_close(struct tty_struct *tty, struct file *file) | |||
774 | spin_lock_irq(&port->port_lock); | 776 | spin_lock_irq(&port->port_lock); |
775 | 777 | ||
776 | if (port->port_open_count == 0) { | 778 | if (port->port_open_count == 0) { |
777 | printk(KERN_ERR | 779 | pr_err("gs_close: (%d,%p,%p) port is already closed\n", |
778 | "gs_close: (%d,%p,%p) port is already closed\n", | ||
779 | port->port_num, tty, file); | 780 | port->port_num, tty, file); |
780 | goto exit; | 781 | goto exit; |
781 | } | 782 | } |
@@ -837,7 +838,7 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count) | |||
837 | int ret; | 838 | int ret; |
838 | 839 | ||
839 | if (port == NULL) { | 840 | if (port == NULL) { |
840 | printk(KERN_ERR "gs_write: NULL port pointer\n"); | 841 | pr_err("gs_write: NULL port pointer\n"); |
841 | return -EIO; | 842 | return -EIO; |
842 | } | 843 | } |
843 | 844 | ||
@@ -850,14 +851,14 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count) | |||
850 | spin_lock_irqsave(&port->port_lock, flags); | 851 | spin_lock_irqsave(&port->port_lock, flags); |
851 | 852 | ||
852 | if (port->port_dev == NULL) { | 853 | if (port->port_dev == NULL) { |
853 | printk(KERN_ERR "gs_write: (%d,%p) port is not connected\n", | 854 | pr_err("gs_write: (%d,%p) port is not connected\n", |
854 | port->port_num, tty); | 855 | port->port_num, tty); |
855 | ret = -EIO; | 856 | ret = -EIO; |
856 | goto exit; | 857 | goto exit; |
857 | } | 858 | } |
858 | 859 | ||
859 | if (port->port_open_count == 0) { | 860 | if (port->port_open_count == 0) { |
860 | printk(KERN_ERR "gs_write: (%d,%p) port is closed\n", | 861 | pr_err("gs_write: (%d,%p) port is closed\n", |
861 | port->port_num, tty); | 862 | port->port_num, tty); |
862 | ret = -EBADF; | 863 | ret = -EBADF; |
863 | goto exit; | 864 | goto exit; |
@@ -888,7 +889,7 @@ static void gs_put_char(struct tty_struct *tty, unsigned char ch) | |||
888 | struct gs_port *port = tty->driver_data; | 889 | struct gs_port *port = tty->driver_data; |
889 | 890 | ||
890 | if (port == NULL) { | 891 | if (port == NULL) { |
891 | printk(KERN_ERR "gs_put_char: NULL port pointer\n"); | 892 | pr_err("gs_put_char: NULL port pointer\n"); |
892 | return; | 893 | return; |
893 | } | 894 | } |
894 | 895 | ||
@@ -898,13 +899,13 @@ static void gs_put_char(struct tty_struct *tty, unsigned char ch) | |||
898 | spin_lock_irqsave(&port->port_lock, flags); | 899 | spin_lock_irqsave(&port->port_lock, flags); |
899 | 900 | ||
900 | if (port->port_dev == NULL) { | 901 | if (port->port_dev == NULL) { |
901 | printk(KERN_ERR "gs_put_char: (%d,%p) port is not connected\n", | 902 | pr_err("gs_put_char: (%d,%p) port is not connected\n", |
902 | port->port_num, tty); | 903 | port->port_num, tty); |
903 | goto exit; | 904 | goto exit; |
904 | } | 905 | } |
905 | 906 | ||
906 | if (port->port_open_count == 0) { | 907 | if (port->port_open_count == 0) { |
907 | printk(KERN_ERR "gs_put_char: (%d,%p) port is closed\n", | 908 | pr_err("gs_put_char: (%d,%p) port is closed\n", |
908 | port->port_num, tty); | 909 | port->port_num, tty); |
909 | goto exit; | 910 | goto exit; |
910 | } | 911 | } |
@@ -924,7 +925,7 @@ static void gs_flush_chars(struct tty_struct *tty) | |||
924 | struct gs_port *port = tty->driver_data; | 925 | struct gs_port *port = tty->driver_data; |
925 | 926 | ||
926 | if (port == NULL) { | 927 | if (port == NULL) { |
927 | printk(KERN_ERR "gs_flush_chars: NULL port pointer\n"); | 928 | pr_err("gs_flush_chars: NULL port pointer\n"); |
928 | return; | 929 | return; |
929 | } | 930 | } |
930 | 931 | ||
@@ -933,14 +934,13 @@ static void gs_flush_chars(struct tty_struct *tty) | |||
933 | spin_lock_irqsave(&port->port_lock, flags); | 934 | spin_lock_irqsave(&port->port_lock, flags); |
934 | 935 | ||
935 | if (port->port_dev == NULL) { | 936 | if (port->port_dev == NULL) { |
936 | printk(KERN_ERR | 937 | pr_err("gs_flush_chars: (%d,%p) port is not connected\n", |
937 | "gs_flush_chars: (%d,%p) port is not connected\n", | ||
938 | port->port_num, tty); | 938 | port->port_num, tty); |
939 | goto exit; | 939 | goto exit; |
940 | } | 940 | } |
941 | 941 | ||
942 | if (port->port_open_count == 0) { | 942 | if (port->port_open_count == 0) { |
943 | printk(KERN_ERR "gs_flush_chars: (%d,%p) port is closed\n", | 943 | pr_err("gs_flush_chars: (%d,%p) port is closed\n", |
944 | port->port_num, tty); | 944 | port->port_num, tty); |
945 | goto exit; | 945 | goto exit; |
946 | } | 946 | } |
@@ -1038,7 +1038,7 @@ static int gs_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, | |||
1038 | struct gs_port *port = tty->driver_data; | 1038 | struct gs_port *port = tty->driver_data; |
1039 | 1039 | ||
1040 | if (port == NULL) { | 1040 | if (port == NULL) { |
1041 | printk(KERN_ERR "gs_ioctl: NULL port pointer\n"); | 1041 | pr_err("gs_ioctl: NULL port pointer\n"); |
1042 | return -EIO; | 1042 | return -EIO; |
1043 | } | 1043 | } |
1044 | 1044 | ||
@@ -1076,7 +1076,7 @@ static int gs_send(struct gs_dev *dev) | |||
1076 | struct gs_req_entry *req_entry; | 1076 | struct gs_req_entry *req_entry; |
1077 | 1077 | ||
1078 | if (dev == NULL) { | 1078 | if (dev == NULL) { |
1079 | printk(KERN_ERR "gs_send: NULL device pointer\n"); | 1079 | pr_err("gs_send: NULL device pointer\n"); |
1080 | return -ENODEV; | 1080 | return -ENODEV; |
1081 | } | 1081 | } |
1082 | 1082 | ||
@@ -1103,7 +1103,7 @@ static int gs_send(struct gs_dev *dev) | |||
1103 | req->length = len; | 1103 | req->length = len; |
1104 | spin_unlock_irqrestore(&dev->dev_lock, flags); | 1104 | spin_unlock_irqrestore(&dev->dev_lock, flags); |
1105 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { | 1105 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { |
1106 | printk(KERN_ERR | 1106 | pr_err( |
1107 | "gs_send: cannot queue read request, ret=%d\n", | 1107 | "gs_send: cannot queue read request, ret=%d\n", |
1108 | ret); | 1108 | ret); |
1109 | spin_lock_irqsave(&dev->dev_lock, flags); | 1109 | spin_lock_irqsave(&dev->dev_lock, flags); |
@@ -1144,9 +1144,7 @@ static int gs_send_packet(struct gs_dev *dev, char *packet, unsigned int size) | |||
1144 | port = dev->dev_port[0]; | 1144 | port = dev->dev_port[0]; |
1145 | 1145 | ||
1146 | if (port == NULL) { | 1146 | if (port == NULL) { |
1147 | printk(KERN_ERR | 1147 | pr_err("gs_send_packet: port=%d, NULL port pointer\n", 0); |
1148 | "gs_send_packet: port=%d, NULL port pointer\n", | ||
1149 | 0); | ||
1150 | return -EIO; | 1148 | return -EIO; |
1151 | } | 1149 | } |
1152 | 1150 | ||
@@ -1193,7 +1191,7 @@ static int gs_recv_packet(struct gs_dev *dev, char *packet, unsigned int size) | |||
1193 | port = dev->dev_port[0]; | 1191 | port = dev->dev_port[0]; |
1194 | 1192 | ||
1195 | if (port == NULL) { | 1193 | if (port == NULL) { |
1196 | printk(KERN_ERR "gs_recv_packet: port=%d, NULL port pointer\n", | 1194 | pr_err("gs_recv_packet: port=%d, NULL port pointer\n", |
1197 | port->port_num); | 1195 | port->port_num); |
1198 | return -EIO; | 1196 | return -EIO; |
1199 | } | 1197 | } |
@@ -1201,7 +1199,7 @@ static int gs_recv_packet(struct gs_dev *dev, char *packet, unsigned int size) | |||
1201 | spin_lock(&port->port_lock); | 1199 | spin_lock(&port->port_lock); |
1202 | 1200 | ||
1203 | if (port->port_open_count == 0) { | 1201 | if (port->port_open_count == 0) { |
1204 | printk(KERN_ERR "gs_recv_packet: port=%d, port is closed\n", | 1202 | pr_err("gs_recv_packet: port=%d, port is closed\n", |
1205 | port->port_num); | 1203 | port->port_num); |
1206 | ret = -EIO; | 1204 | ret = -EIO; |
1207 | goto exit; | 1205 | goto exit; |
@@ -1211,14 +1209,14 @@ static int gs_recv_packet(struct gs_dev *dev, char *packet, unsigned int size) | |||
1211 | tty = port->port_tty; | 1209 | tty = port->port_tty; |
1212 | 1210 | ||
1213 | if (tty == NULL) { | 1211 | if (tty == NULL) { |
1214 | printk(KERN_ERR "gs_recv_packet: port=%d, NULL tty pointer\n", | 1212 | pr_err("gs_recv_packet: port=%d, NULL tty pointer\n", |
1215 | port->port_num); | 1213 | port->port_num); |
1216 | ret = -EIO; | 1214 | ret = -EIO; |
1217 | goto exit; | 1215 | goto exit; |
1218 | } | 1216 | } |
1219 | 1217 | ||
1220 | if (port->port_tty->magic != TTY_MAGIC) { | 1218 | if (port->port_tty->magic != TTY_MAGIC) { |
1221 | printk(KERN_ERR "gs_recv_packet: port=%d, bad tty magic\n", | 1219 | pr_err("gs_recv_packet: port=%d, bad tty magic\n", |
1222 | port->port_num); | 1220 | port->port_num); |
1223 | ret = -EIO; | 1221 | ret = -EIO; |
1224 | goto exit; | 1222 | goto exit; |
@@ -1245,7 +1243,7 @@ static void gs_read_complete(struct usb_ep *ep, struct usb_request *req) | |||
1245 | struct gs_dev *dev = ep->driver_data; | 1243 | struct gs_dev *dev = ep->driver_data; |
1246 | 1244 | ||
1247 | if (dev == NULL) { | 1245 | if (dev == NULL) { |
1248 | printk(KERN_ERR "gs_read_complete: NULL device pointer\n"); | 1246 | pr_err("gs_read_complete: NULL device pointer\n"); |
1249 | return; | 1247 | return; |
1250 | } | 1248 | } |
1251 | 1249 | ||
@@ -1256,7 +1254,7 @@ static void gs_read_complete(struct usb_ep *ep, struct usb_request *req) | |||
1256 | requeue: | 1254 | requeue: |
1257 | req->length = ep->maxpacket; | 1255 | req->length = ep->maxpacket; |
1258 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { | 1256 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { |
1259 | printk(KERN_ERR | 1257 | pr_err( |
1260 | "gs_read_complete: cannot queue read request, ret=%d\n", | 1258 | "gs_read_complete: cannot queue read request, ret=%d\n", |
1261 | ret); | 1259 | ret); |
1262 | } | 1260 | } |
@@ -1270,7 +1268,7 @@ requeue: | |||
1270 | 1268 | ||
1271 | default: | 1269 | default: |
1272 | /* unexpected */ | 1270 | /* unexpected */ |
1273 | printk(KERN_ERR | 1271 | pr_err( |
1274 | "gs_read_complete: unexpected status error, status=%d\n", | 1272 | "gs_read_complete: unexpected status error, status=%d\n", |
1275 | req->status); | 1273 | req->status); |
1276 | goto requeue; | 1274 | goto requeue; |
@@ -1287,7 +1285,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req) | |||
1287 | struct gs_req_entry *gs_req = req->context; | 1285 | struct gs_req_entry *gs_req = req->context; |
1288 | 1286 | ||
1289 | if (dev == NULL) { | 1287 | if (dev == NULL) { |
1290 | printk(KERN_ERR "gs_write_complete: NULL device pointer\n"); | 1288 | pr_err("gs_write_complete: NULL device pointer\n"); |
1291 | return; | 1289 | return; |
1292 | } | 1290 | } |
1293 | 1291 | ||
@@ -1296,8 +1294,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req) | |||
1296 | /* normal completion */ | 1294 | /* normal completion */ |
1297 | requeue: | 1295 | requeue: |
1298 | if (gs_req == NULL) { | 1296 | if (gs_req == NULL) { |
1299 | printk(KERN_ERR | 1297 | pr_err("gs_write_complete: NULL request pointer\n"); |
1300 | "gs_write_complete: NULL request pointer\n"); | ||
1301 | return; | 1298 | return; |
1302 | } | 1299 | } |
1303 | 1300 | ||
@@ -1316,7 +1313,7 @@ requeue: | |||
1316 | break; | 1313 | break; |
1317 | 1314 | ||
1318 | default: | 1315 | default: |
1319 | printk(KERN_ERR | 1316 | pr_err( |
1320 | "gs_write_complete: unexpected status error, status=%d\n", | 1317 | "gs_write_complete: unexpected status error, status=%d\n", |
1321 | req->status); | 1318 | req->status); |
1322 | goto requeue; | 1319 | goto requeue; |
@@ -1351,7 +1348,7 @@ static int __init gs_bind(struct usb_gadget *gadget) | |||
1351 | gs_device_desc.bcdDevice = | 1348 | gs_device_desc.bcdDevice = |
1352 | cpu_to_le16(GS_VERSION_NUM | gcnum); | 1349 | cpu_to_le16(GS_VERSION_NUM | gcnum); |
1353 | else { | 1350 | else { |
1354 | printk(KERN_WARNING "gs_bind: controller '%s' not recognized\n", | 1351 | pr_warning("gs_bind: controller '%s' not recognized\n", |
1355 | gadget->name); | 1352 | gadget->name); |
1356 | /* unrecognized, but safe unless bulk is REALLY quirky */ | 1353 | /* unrecognized, but safe unless bulk is REALLY quirky */ |
1357 | gs_device_desc.bcdDevice = | 1354 | gs_device_desc.bcdDevice = |
@@ -1375,7 +1372,7 @@ static int __init gs_bind(struct usb_gadget *gadget) | |||
1375 | if (use_acm) { | 1372 | if (use_acm) { |
1376 | ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc); | 1373 | ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc); |
1377 | if (!ep) { | 1374 | if (!ep) { |
1378 | printk(KERN_ERR "gs_bind: cannot run ACM on %s\n", gadget->name); | 1375 | pr_err("gs_bind: cannot run ACM on %s\n", gadget->name); |
1379 | goto autoconf_fail; | 1376 | goto autoconf_fail; |
1380 | } | 1377 | } |
1381 | gs_device_desc.idProduct = __constant_cpu_to_le16( | 1378 | gs_device_desc.idProduct = __constant_cpu_to_le16( |
@@ -1425,7 +1422,7 @@ static int __init gs_bind(struct usb_gadget *gadget) | |||
1425 | set_gadget_data(gadget, dev); | 1422 | set_gadget_data(gadget, dev); |
1426 | 1423 | ||
1427 | if ((ret=gs_alloc_ports(dev, GFP_KERNEL)) != 0) { | 1424 | if ((ret=gs_alloc_ports(dev, GFP_KERNEL)) != 0) { |
1428 | printk(KERN_ERR "gs_bind: cannot allocate ports\n"); | 1425 | pr_err("gs_bind: cannot allocate ports\n"); |
1429 | gs_unbind(gadget); | 1426 | gs_unbind(gadget); |
1430 | return ret; | 1427 | return ret; |
1431 | } | 1428 | } |
@@ -1441,13 +1438,13 @@ static int __init gs_bind(struct usb_gadget *gadget) | |||
1441 | 1438 | ||
1442 | gadget->ep0->driver_data = dev; | 1439 | gadget->ep0->driver_data = dev; |
1443 | 1440 | ||
1444 | printk(KERN_INFO "gs_bind: %s %s bound\n", | 1441 | pr_info("gs_bind: %s %s bound\n", |
1445 | GS_LONG_NAME, GS_VERSION_STR); | 1442 | GS_LONG_NAME, GS_VERSION_STR); |
1446 | 1443 | ||
1447 | return 0; | 1444 | return 0; |
1448 | 1445 | ||
1449 | autoconf_fail: | 1446 | autoconf_fail: |
1450 | printk(KERN_ERR "gs_bind: cannot autoconfigure on %s\n", gadget->name); | 1447 | pr_err("gs_bind: cannot autoconfigure on %s\n", gadget->name); |
1451 | return -ENODEV; | 1448 | return -ENODEV; |
1452 | } | 1449 | } |
1453 | 1450 | ||
@@ -1480,7 +1477,7 @@ static void /* __init_or_exit */ gs_unbind(struct usb_gadget *gadget) | |||
1480 | set_gadget_data(gadget, NULL); | 1477 | set_gadget_data(gadget, NULL); |
1481 | } | 1478 | } |
1482 | 1479 | ||
1483 | printk(KERN_INFO "gs_unbind: %s %s unbound\n", GS_LONG_NAME, | 1480 | pr_info("gs_unbind: %s %s unbound\n", GS_LONG_NAME, |
1484 | GS_VERSION_STR); | 1481 | GS_VERSION_STR); |
1485 | } | 1482 | } |
1486 | 1483 | ||
@@ -1513,7 +1510,8 @@ static int gs_setup(struct usb_gadget *gadget, | |||
1513 | break; | 1510 | break; |
1514 | 1511 | ||
1515 | default: | 1512 | default: |
1516 | printk(KERN_ERR "gs_setup: unknown request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n", | 1513 | pr_err("gs_setup: unknown request, type=%02x, request=%02x, " |
1514 | "value=%04x, index=%04x, length=%d\n", | ||
1517 | ctrl->bRequestType, ctrl->bRequest, | 1515 | ctrl->bRequestType, ctrl->bRequest, |
1518 | wValue, wIndex, wLength); | 1516 | wValue, wIndex, wLength); |
1519 | break; | 1517 | break; |
@@ -1526,7 +1524,7 @@ static int gs_setup(struct usb_gadget *gadget, | |||
1526 | && (ret % gadget->ep0->maxpacket) == 0; | 1524 | && (ret % gadget->ep0->maxpacket) == 0; |
1527 | ret = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC); | 1525 | ret = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC); |
1528 | if (ret < 0) { | 1526 | if (ret < 0) { |
1529 | printk(KERN_ERR "gs_setup: cannot queue response, ret=%d\n", | 1527 | pr_err("gs_setup: cannot queue response, ret=%d\n", |
1530 | ret); | 1528 | ret); |
1531 | req->status = 0; | 1529 | req->status = 0; |
1532 | gs_setup_complete(gadget->ep0, req); | 1530 | gs_setup_complete(gadget->ep0, req); |
@@ -1656,7 +1654,8 @@ set_interface_done: | |||
1656 | break; | 1654 | break; |
1657 | 1655 | ||
1658 | default: | 1656 | default: |
1659 | printk(KERN_ERR "gs_setup: unknown standard request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n", | 1657 | pr_err("gs_setup: unknown standard request, type=%02x, " |
1658 | "request=%02x, value=%04x, index=%04x, length=%d\n", | ||
1660 | ctrl->bRequestType, ctrl->bRequest, | 1659 | ctrl->bRequestType, ctrl->bRequest, |
1661 | wValue, wIndex, wLength); | 1660 | wValue, wIndex, wLength); |
1662 | break; | 1661 | break; |
@@ -1682,7 +1681,7 @@ static int gs_setup_class(struct usb_gadget *gadget, | |||
1682 | * handler copy that data to port->port_line_coding (iff | 1681 | * handler copy that data to port->port_line_coding (iff |
1683 | * it's valid) and maybe pass it on. Until then, fail. | 1682 | * it's valid) and maybe pass it on. Until then, fail. |
1684 | */ | 1683 | */ |
1685 | printk(KERN_WARNING "gs_setup: set_line_coding " | 1684 | pr_warning("gs_setup: set_line_coding " |
1686 | "unuspported\n"); | 1685 | "unuspported\n"); |
1687 | break; | 1686 | break; |
1688 | 1687 | ||
@@ -1702,12 +1701,12 @@ static int gs_setup_class(struct usb_gadget *gadget, | |||
1702 | * handler use that to set the state (iff it's valid) and | 1701 | * handler use that to set the state (iff it's valid) and |
1703 | * maybe pass it on. Until then, fail. | 1702 | * maybe pass it on. Until then, fail. |
1704 | */ | 1703 | */ |
1705 | printk(KERN_WARNING "gs_setup: set_control_line_state " | 1704 | pr_warning("gs_setup: set_control_line_state " |
1706 | "unuspported\n"); | 1705 | "unuspported\n"); |
1707 | break; | 1706 | break; |
1708 | 1707 | ||
1709 | default: | 1708 | default: |
1710 | printk(KERN_ERR "gs_setup: unknown class request, " | 1709 | pr_err("gs_setup: unknown class request, " |
1711 | "type=%02x, request=%02x, value=%04x, " | 1710 | "type=%02x, request=%02x, value=%04x, " |
1712 | "index=%04x, length=%d\n", | 1711 | "index=%04x, length=%d\n", |
1713 | ctrl->bRequestType, ctrl->bRequest, | 1712 | ctrl->bRequestType, ctrl->bRequest, |
@@ -1724,7 +1723,8 @@ static int gs_setup_class(struct usb_gadget *gadget, | |||
1724 | static void gs_setup_complete(struct usb_ep *ep, struct usb_request *req) | 1723 | static void gs_setup_complete(struct usb_ep *ep, struct usb_request *req) |
1725 | { | 1724 | { |
1726 | if (req->status || req->actual != req->length) { | 1725 | if (req->status || req->actual != req->length) { |
1727 | printk(KERN_ERR "gs_setup_complete: status error, status=%d, actual=%d, length=%d\n", | 1726 | pr_err("gs_setup_complete: status error, status=%d, " |
1727 | "actual=%d, length=%d\n", | ||
1728 | req->status, req->actual, req->length); | 1728 | req->status, req->actual, req->length); |
1729 | } | 1729 | } |
1730 | } | 1730 | } |
@@ -1751,11 +1751,11 @@ static void gs_disconnect(struct usb_gadget *gadget) | |||
1751 | 1751 | ||
1752 | /* re-allocate ports for the next connection */ | 1752 | /* re-allocate ports for the next connection */ |
1753 | if (gs_alloc_ports(dev, GFP_ATOMIC) != 0) | 1753 | if (gs_alloc_ports(dev, GFP_ATOMIC) != 0) |
1754 | printk(KERN_ERR "gs_disconnect: cannot re-allocate ports\n"); | 1754 | pr_err("gs_disconnect: cannot re-allocate ports\n"); |
1755 | 1755 | ||
1756 | spin_unlock_irqrestore(&dev->dev_lock, flags); | 1756 | spin_unlock_irqrestore(&dev->dev_lock, flags); |
1757 | 1757 | ||
1758 | printk(KERN_INFO "gs_disconnect: %s disconnected\n", GS_LONG_NAME); | 1758 | pr_info("gs_disconnect: %s disconnected\n", GS_LONG_NAME); |
1759 | } | 1759 | } |
1760 | 1760 | ||
1761 | /* | 1761 | /* |
@@ -1778,7 +1778,7 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1778 | struct gs_req_entry *req_entry; | 1778 | struct gs_req_entry *req_entry; |
1779 | 1779 | ||
1780 | if (dev == NULL) { | 1780 | if (dev == NULL) { |
1781 | printk(KERN_ERR "gs_set_config: NULL device pointer\n"); | 1781 | pr_err("gs_set_config: NULL device pointer\n"); |
1782 | return 0; | 1782 | return 0; |
1783 | } | 1783 | } |
1784 | 1784 | ||
@@ -1823,7 +1823,8 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1823 | dev->dev_notify_ep = ep; | 1823 | dev->dev_notify_ep = ep; |
1824 | dev->dev_notify_ep_desc = ep_desc; | 1824 | dev->dev_notify_ep_desc = ep_desc; |
1825 | } else { | 1825 | } else { |
1826 | printk(KERN_ERR "gs_set_config: cannot enable notify endpoint %s, ret=%d\n", | 1826 | pr_err("gs_set_config: cannot enable NOTIFY " |
1827 | "endpoint %s, ret=%d\n", | ||
1827 | ep->name, ret); | 1828 | ep->name, ret); |
1828 | goto exit_reset_config; | 1829 | goto exit_reset_config; |
1829 | } | 1830 | } |
@@ -1839,7 +1840,8 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1839 | dev->dev_in_ep = ep; | 1840 | dev->dev_in_ep = ep; |
1840 | dev->dev_in_ep_desc = ep_desc; | 1841 | dev->dev_in_ep_desc = ep_desc; |
1841 | } else { | 1842 | } else { |
1842 | printk(KERN_ERR "gs_set_config: cannot enable in endpoint %s, ret=%d\n", | 1843 | pr_err("gs_set_config: cannot enable IN " |
1844 | "endpoint %s, ret=%d\n", | ||
1843 | ep->name, ret); | 1845 | ep->name, ret); |
1844 | goto exit_reset_config; | 1846 | goto exit_reset_config; |
1845 | } | 1847 | } |
@@ -1855,7 +1857,8 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1855 | dev->dev_out_ep = ep; | 1857 | dev->dev_out_ep = ep; |
1856 | dev->dev_out_ep_desc = ep_desc; | 1858 | dev->dev_out_ep_desc = ep_desc; |
1857 | } else { | 1859 | } else { |
1858 | printk(KERN_ERR "gs_set_config: cannot enable out endpoint %s, ret=%d\n", | 1860 | pr_err("gs_set_config: cannot enable OUT " |
1861 | "endpoint %s, ret=%d\n", | ||
1859 | ep->name, ret); | 1862 | ep->name, ret); |
1860 | goto exit_reset_config; | 1863 | goto exit_reset_config; |
1861 | } | 1864 | } |
@@ -1865,7 +1868,7 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1865 | 1868 | ||
1866 | if (dev->dev_in_ep == NULL || dev->dev_out_ep == NULL | 1869 | if (dev->dev_in_ep == NULL || dev->dev_out_ep == NULL |
1867 | || (config != GS_BULK_CONFIG_ID && dev->dev_notify_ep == NULL)) { | 1870 | || (config != GS_BULK_CONFIG_ID && dev->dev_notify_ep == NULL)) { |
1868 | printk(KERN_ERR "gs_set_config: cannot find endpoints\n"); | 1871 | pr_err("gs_set_config: cannot find endpoints\n"); |
1869 | ret = -ENODEV; | 1872 | ret = -ENODEV; |
1870 | goto exit_reset_config; | 1873 | goto exit_reset_config; |
1871 | } | 1874 | } |
@@ -1876,11 +1879,12 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1876 | if ((req=gs_alloc_req(ep, ep->maxpacket, GFP_ATOMIC))) { | 1879 | if ((req=gs_alloc_req(ep, ep->maxpacket, GFP_ATOMIC))) { |
1877 | req->complete = gs_read_complete; | 1880 | req->complete = gs_read_complete; |
1878 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { | 1881 | if ((ret=usb_ep_queue(ep, req, GFP_ATOMIC))) { |
1879 | printk(KERN_ERR "gs_set_config: cannot queue read request, ret=%d\n", | 1882 | pr_err("gs_set_config: cannot queue read " |
1880 | ret); | 1883 | "request, ret=%d\n", ret); |
1881 | } | 1884 | } |
1882 | } else { | 1885 | } else { |
1883 | printk(KERN_ERR "gs_set_config: cannot allocate read requests\n"); | 1886 | pr_err("gs_set_config: cannot allocate " |
1887 | "read requests\n"); | ||
1884 | ret = -ENOMEM; | 1888 | ret = -ENOMEM; |
1885 | goto exit_reset_config; | 1889 | goto exit_reset_config; |
1886 | } | 1890 | } |
@@ -1893,13 +1897,14 @@ static int gs_set_config(struct gs_dev *dev, unsigned config) | |||
1893 | req_entry->re_req->complete = gs_write_complete; | 1897 | req_entry->re_req->complete = gs_write_complete; |
1894 | list_add(&req_entry->re_entry, &dev->dev_req_list); | 1898 | list_add(&req_entry->re_entry, &dev->dev_req_list); |
1895 | } else { | 1899 | } else { |
1896 | printk(KERN_ERR "gs_set_config: cannot allocate write requests\n"); | 1900 | pr_err("gs_set_config: cannot allocate " |
1901 | "write requests\n"); | ||
1897 | ret = -ENOMEM; | 1902 | ret = -ENOMEM; |
1898 | goto exit_reset_config; | 1903 | goto exit_reset_config; |
1899 | } | 1904 | } |
1900 | } | 1905 | } |
1901 | 1906 | ||
1902 | printk(KERN_INFO "gs_set_config: %s configured, %s speed %s config\n", | 1907 | pr_info("gs_set_config: %s configured, %s speed %s config\n", |
1903 | GS_LONG_NAME, | 1908 | GS_LONG_NAME, |
1904 | gadget->speed == USB_SPEED_HIGH ? "high" : "full", | 1909 | gadget->speed == USB_SPEED_HIGH ? "high" : "full", |
1905 | config == GS_BULK_CONFIG_ID ? "BULK" : "CDC-ACM"); | 1910 | config == GS_BULK_CONFIG_ID ? "BULK" : "CDC-ACM"); |
@@ -1926,7 +1931,7 @@ static void gs_reset_config(struct gs_dev *dev) | |||
1926 | struct gs_req_entry *req_entry; | 1931 | struct gs_req_entry *req_entry; |
1927 | 1932 | ||
1928 | if (dev == NULL) { | 1933 | if (dev == NULL) { |
1929 | printk(KERN_ERR "gs_reset_config: NULL device pointer\n"); | 1934 | pr_err("gs_reset_config: NULL device pointer\n"); |
1930 | return; | 1935 | return; |
1931 | } | 1936 | } |
1932 | 1937 | ||
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index fcde5d9c87df..d3d4f4048e6c 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
@@ -1115,7 +1115,7 @@ zero_bind (struct usb_gadget *gadget) | |||
1115 | ep = usb_ep_autoconfig (gadget, &fs_source_desc); | 1115 | ep = usb_ep_autoconfig (gadget, &fs_source_desc); |
1116 | if (!ep) { | 1116 | if (!ep) { |
1117 | autoconf_fail: | 1117 | autoconf_fail: |
1118 | printk (KERN_ERR "%s: can't autoconfigure on %s\n", | 1118 | pr_err("%s: can't autoconfigure on %s\n", |
1119 | shortname, gadget->name); | 1119 | shortname, gadget->name); |
1120 | return -ENODEV; | 1120 | return -ENODEV; |
1121 | } | 1121 | } |
@@ -1139,7 +1139,7 @@ autoconf_fail: | |||
1139 | * things like configuration and altsetting numbering | 1139 | * things like configuration and altsetting numbering |
1140 | * can need hardware-specific attention though. | 1140 | * can need hardware-specific attention though. |
1141 | */ | 1141 | */ |
1142 | printk (KERN_WARNING "%s: controller '%s' not recognized\n", | 1142 | pr_warning("%s: controller '%s' not recognized\n", |
1143 | shortname, gadget->name); | 1143 | shortname, gadget->name); |
1144 | device_desc.bcdDevice = __constant_cpu_to_le16 (0x9999); | 1144 | device_desc.bcdDevice = __constant_cpu_to_le16 (0x9999); |
1145 | } | 1145 | } |