Commit 00274921 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 269954e5
...@@ -158,12 +158,6 @@ struct at91_request { ...@@ -158,12 +158,6 @@ struct at91_request {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifdef DEBUG
#define DBG(stuff...) printk(KERN_DEBUG "udc: " stuff)
#else
#define DBG(stuff...) do{}while(0)
#endif
#ifdef VERBOSE #ifdef VERBOSE
# define VDBG DBG # define VDBG DBG
#else #else
...@@ -176,9 +170,10 @@ struct at91_request { ...@@ -176,9 +170,10 @@ struct at91_request {
# define PACKET(stuff...) do{}while(0) # define PACKET(stuff...) do{}while(0)
#endif #endif
#define ERR(stuff...) printk(KERN_ERR "udc: " stuff) #define ERR(stuff...) pr_err("udc: " stuff)
#define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) #define WARN(stuff...) pr_warning("udc: " stuff)
#define INFO(stuff...) printk(KERN_INFO "udc: " stuff) #define INFO(stuff...) pr_info("udc: " stuff)
#define DBG(stuff...) pr_debug("udc: " stuff)
#endif #endif
...@@ -1384,8 +1384,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep, ...@@ -1384,8 +1384,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
return retval; return retval;
stall: stall:
printk(KERN_ERR pr_err("udc: %s: Invalid setup request: %02x.%02x v%04x i%04x l%d, "
"udc: %s: Invalid setup request: %02x.%02x v%04x i%04x l%d, "
"halting endpoint...\n", "halting endpoint...\n",
ep->ep.name, crq->bRequestType, crq->bRequest, ep->ep.name, crq->bRequestType, crq->bRequest,
le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex), le16_to_cpu(crq->wValue), le16_to_cpu(crq->wIndex),
...@@ -1456,8 +1455,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep) ...@@ -1456,8 +1455,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep)
set_protocol_stall(udc, ep); set_protocol_stall(udc, ep);
break; break;
default: default:
printk(KERN_ERR pr_err("udc: %s: TXCOMP: Invalid endpoint state %d, "
"udc: %s: TXCOMP: Invalid endpoint state %d, "
"halting endpoint...\n", "halting endpoint...\n",
ep->ep.name, ep->state); ep->ep.name, ep->state);
set_protocol_stall(udc, ep); set_protocol_stall(udc, ep);
...@@ -1486,8 +1484,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep) ...@@ -1486,8 +1484,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep)
default: default:
usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY); usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY);
usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY); usba_ep_writel(ep, CTL_DIS, USBA_RX_BK_RDY);
printk(KERN_ERR pr_err("udc: %s: RXRDY: Invalid endpoint state %d, "
"udc: %s: RXRDY: Invalid endpoint state %d, "
"halting endpoint...\n", "halting endpoint...\n",
ep->ep.name, ep->state); ep->ep.name, ep->state);
set_protocol_stall(udc, ep); set_protocol_stall(udc, ep);
...@@ -1532,7 +1529,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep) ...@@ -1532,7 +1529,7 @@ static void usba_control_irq(struct usba_udc *udc, struct usba_ep *ep)
pkt_len = USBA_BFEXT(BYTE_COUNT, usba_ep_readl(ep, STA)); pkt_len = USBA_BFEXT(BYTE_COUNT, usba_ep_readl(ep, STA));
DBG(DBG_HW, "Packet length: %u\n", pkt_len); DBG(DBG_HW, "Packet length: %u\n", pkt_len);
if (pkt_len != sizeof(crq)) { if (pkt_len != sizeof(crq)) {
printk(KERN_WARNING "udc: Invalid packet length %u " pr_warning("udc: Invalid packet length %u "
"(expected %lu)\n", pkt_len, sizeof(crq)); "(expected %lu)\n", pkt_len, sizeof(crq));
set_protocol_stall(udc, ep); set_protocol_stall(udc, ep);
return; return;
......
...@@ -216,7 +216,6 @@ ...@@ -216,7 +216,6 @@
#define FIFO_IOMEM_ID 0 #define FIFO_IOMEM_ID 0
#define CTRL_IOMEM_ID 1 #define CTRL_IOMEM_ID 1
#ifdef DEBUG
#define DBG_ERR 0x0001 /* report all error returns */ #define DBG_ERR 0x0001 /* report all error returns */
#define DBG_HW 0x0002 /* debug hardware initialization */ #define DBG_HW 0x0002 /* debug hardware initialization */
#define DBG_GADGET 0x0004 /* calls to/from gadget driver */ #define DBG_GADGET 0x0004 /* calls to/from gadget driver */
...@@ -230,14 +229,12 @@ ...@@ -230,14 +229,12 @@
#define DBG_NONE 0x0000 #define DBG_NONE 0x0000
#define DEBUG_LEVEL (DBG_ERR) #define DEBUG_LEVEL (DBG_ERR)
#define DBG(level, fmt, ...) \ #define DBG(level, fmt, ...) \
do { \ do { \
if ((level) & DEBUG_LEVEL) \ if ((level) & DEBUG_LEVEL) \
printk(KERN_DEBUG "udc: " fmt, ## __VA_ARGS__); \ pr_debug("udc: " fmt, ## __VA_ARGS__); \
} while (0) } while (0)
#else
#define DBG(level, fmt...)
#endif
enum usba_ctrl_state { enum usba_ctrl_state {
WAIT_FOR_SETUP, WAIT_FOR_SETUP,
......
...@@ -275,19 +275,15 @@ MODULE_LICENSE("Dual BSD/GPL"); ...@@ -275,19 +275,15 @@ MODULE_LICENSE("Dual BSD/GPL");
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifdef DEBUG
#define LDBG(lun,fmt,args...) \ #define LDBG(lun,fmt,args...) \
dev_dbg(&(lun)->dev , fmt , ## args) dev_dbg(&(lun)->dev , fmt , ## args)
#define MDBG(fmt,args...) \ #define MDBG(fmt,args...) \
printk(KERN_DEBUG DRIVER_NAME ": " fmt , ## args) pr_debug(DRIVER_NAME ": " fmt , ## args)
#else
#define LDBG(lun,fmt,args...) \ #ifndef DEBUG
do { } while (0)
#define MDBG(fmt,args...) \
do { } while (0)
#undef VERBOSE_DEBUG #undef VERBOSE_DEBUG
#undef DUMP_MSGS #undef DUMP_MSGS
#endif /* DEBUG */ #endif /* !DEBUG */
#ifdef VERBOSE_DEBUG #ifdef VERBOSE_DEBUG
#define VLDBG LDBG #define VLDBG LDBG
...@@ -304,7 +300,7 @@ MODULE_LICENSE("Dual BSD/GPL"); ...@@ -304,7 +300,7 @@ MODULE_LICENSE("Dual BSD/GPL");
dev_info(&(lun)->dev , fmt , ## args) dev_info(&(lun)->dev , fmt , ## args)
#define MINFO(fmt,args...) \ #define MINFO(fmt,args...) \
printk(KERN_INFO DRIVER_NAME ": " fmt , ## args) pr_info(DRIVER_NAME ": " fmt , ## args)
#define DBG(d, fmt, args...) \ #define DBG(d, fmt, args...) \
dev_dbg(&(d)->gadget->dev , fmt , ## args) dev_dbg(&(d)->gadget->dev , fmt , ## args)
......
...@@ -551,9 +551,9 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length) ...@@ -551,9 +551,9 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length)
#define VDBG(stuff...) do{}while(0) #define VDBG(stuff...) do{}while(0)
#endif #endif
#define ERR(stuff...) printk(KERN_ERR "udc: " stuff) #define ERR(stuff...) pr_err("udc: " stuff)
#define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) #define WARN(stuff...) pr_warning("udc: " stuff)
#define INFO(stuff...) printk(KERN_INFO "udc: " stuff) #define INFO(stuff...) pr_info("udc: " stuff)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
...@@ -1158,7 +1158,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget) ...@@ -1158,7 +1158,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget)
/* support optional vendor/distro customization */ /* support optional vendor/distro customization */
if (idVendor) { if (idVendor) {
if (!idProduct) { if (!idProduct) {
printk(KERN_ERR "idVendor needs idProduct!\n"); pr_err("idVendor needs idProduct!\n");
return -ENODEV; return -ENODEV;
} }
device_desc.idVendor = cpu_to_le16(idVendor); device_desc.idVendor = cpu_to_le16(idVendor);
...@@ -1190,7 +1190,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget) ...@@ -1190,7 +1190,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget)
in_ep = usb_ep_autoconfig(gadget, &bulk_in_desc); in_ep = usb_ep_autoconfig(gadget, &bulk_in_desc);
if (!in_ep) { if (!in_ep) {
autoconf_fail: autoconf_fail:
printk(KERN_ERR "%s: can't autoconfigure on %s\n", pr_err("%s: can't autoconfigure on %s\n",
shortname, gadget->name); shortname, gadget->name);
return -ENODEV; return -ENODEV;
} }
...@@ -1212,7 +1212,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget) ...@@ -1212,7 +1212,7 @@ static int __devinit gmidi_bind(struct usb_gadget *gadget)
* it SHOULD NOT have problems with bulk-capable hardware. * it SHOULD NOT have problems with bulk-capable hardware.
* so warn about unrecognized controllers, don't panic. * so warn about unrecognized controllers, don't panic.
*/ */
printk(KERN_WARNING "%s: controller '%s' not recognized\n", pr_warning("%s: controller '%s' not recognized\n",
shortname, gadget->name); shortname, gadget->name);
device_desc.bcdDevice = __constant_cpu_to_le16(0x9999); device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
} }
......
...@@ -1699,7 +1699,7 @@ gadgetfs_bind (struct usb_gadget *gadget) ...@@ -1699,7 +1699,7 @@ gadgetfs_bind (struct usb_gadget *gadget)
if (!dev) if (!dev)
return -ESRCH; return -ESRCH;
if (0 != strcmp (CHIP, gadget->name)) { if (0 != strcmp (CHIP, gadget->name)) {
printk (KERN_ERR "%s expected %s controller not %s\n", pr_err("%s expected %s controller not %s\n",
shortname, CHIP, gadget->name); shortname, CHIP, gadget->name);
return -ENODEV; return -ENODEV;
} }
......
...@@ -147,7 +147,7 @@ static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum) ...@@ -147,7 +147,7 @@ static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum)
offset = get_pipectr_addr(pipenum); offset = get_pipectr_addr(pipenum);
pid = m66592_read(m66592, offset) & M66592_PID; pid = m66592_read(m66592, offset) & M66592_PID;
} else } else
printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); pr_err("unexpect pipe num (%d)\n", pipenum);
return pid; return pid;
} }
...@@ -163,7 +163,7 @@ static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum, ...@@ -163,7 +163,7 @@ static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum,
offset = get_pipectr_addr(pipenum); offset = get_pipectr_addr(pipenum);
m66592_mdfy(m66592, pid, M66592_PID, offset); m66592_mdfy(m66592, pid, M66592_PID, offset);
} else } else
printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); pr_err("unexpect pipe num (%d)\n", pipenum);
} }
static inline void pipe_start(struct m66592 *m66592, u16 pipenum) 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,7 +192,7 @@ static inline u16 control_reg_get(struct m66592 *m66592, u16 pipenum)
offset = get_pipectr_addr(pipenum); offset = get_pipectr_addr(pipenum);
ret = m66592_read(m66592, offset); ret = m66592_read(m66592, offset);
} else } else
printk(KERN_ERR "unexpect pipe num (%d)\n", pipenum); pr_err("unexpect pipe num (%d)\n", pipenum);
return ret; return ret;
} }
...@@ -209,7 +209,7 @@ static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum) ...@@ -209,7 +209,7 @@ static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum)
offset = get_pipectr_addr(pipenum); offset = get_pipectr_addr(pipenum);
m66592_bset(m66592, M66592_SQCLR, offset); m66592_bset(m66592, M66592_SQCLR, offset);
} else } else
printk(KERN_ERR "unexpect pipe num(%d)\n", pipenum); pr_err("unexpect pipe num(%d)\n", pipenum);
} }
static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum)
...@@ -291,7 +291,7 @@ static int pipe_buffer_setting(struct m66592 *m66592, ...@@ -291,7 +291,7 @@ static int pipe_buffer_setting(struct m66592 *m66592,
break; break;
} }
if (m66592->bi_bufnum > M66592_MAX_BUFNUM) { if (m66592->bi_bufnum > M66592_MAX_BUFNUM) {
printk(KERN_ERR "m66592 pipe memory is insufficient(%d)\n", pr_err("m66592 pipe memory is insufficient(%d)\n",
m66592->bi_bufnum); m66592->bi_bufnum);
return -ENOMEM; return -ENOMEM;
} }
...@@ -332,7 +332,7 @@ static void pipe_buffer_release(struct m66592 *m66592, ...@@ -332,7 +332,7 @@ static void pipe_buffer_release(struct m66592 *m66592,
if (info->type == M66592_BULK) if (info->type == M66592_BULK)
m66592->bulk--; m66592->bulk--;
} else } else
printk(KERN_ERR "ep_release: unexpect pipenum (%d)\n", pr_err("ep_release: unexpect pipenum (%d)\n",
info->pipe); info->pipe);
} }
...@@ -430,7 +430,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, ...@@ -430,7 +430,7 @@ static int alloc_pipe_config(struct m66592_ep *ep,
case USB_ENDPOINT_XFER_BULK: case USB_ENDPOINT_XFER_BULK:
if (m66592->bulk >= M66592_MAX_NUM_BULK) { if (m66592->bulk >= M66592_MAX_NUM_BULK) {
if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { if (m66592->isochronous >= M66592_MAX_NUM_ISOC) {
printk(KERN_ERR "bulk pipe is insufficient\n"); pr_err("bulk pipe is insufficient\n");
return -ENODEV; return -ENODEV;
} else { } else {
info.pipe = M66592_BASE_PIPENUM_ISOC info.pipe = M66592_BASE_PIPENUM_ISOC
...@@ -446,7 +446,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, ...@@ -446,7 +446,7 @@ static int alloc_pipe_config(struct m66592_ep *ep,
break; break;
case USB_ENDPOINT_XFER_INT: case USB_ENDPOINT_XFER_INT:
if (m66592->interrupt >= M66592_MAX_NUM_INT) { if (m66592->interrupt >= M66592_MAX_NUM_INT) {
printk(KERN_ERR "interrupt pipe is insufficient\n"); pr_err("interrupt pipe is insufficient\n");
return -ENODEV; return -ENODEV;
} }
info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt; info.pipe = M66592_BASE_PIPENUM_INT + m66592->interrupt;
...@@ -455,7 +455,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, ...@@ -455,7 +455,7 @@ static int alloc_pipe_config(struct m66592_ep *ep,
break; break;
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
if (m66592->isochronous >= M66592_MAX_NUM_ISOC) { if (m66592->isochronous >= M66592_MAX_NUM_ISOC) {
printk(KERN_ERR "isochronous pipe is insufficient\n"); pr_err("isochronous pipe is insufficient\n");
return -ENODEV; return -ENODEV;
} }
info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous; info.pipe = M66592_BASE_PIPENUM_ISOC + m66592->isochronous;
...@@ -463,7 +463,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, ...@@ -463,7 +463,7 @@ static int alloc_pipe_config(struct m66592_ep *ep,
counter = &m66592->isochronous; counter = &m66592->isochronous;
break; break;
default: default:
printk(KERN_ERR "unexpect xfer type\n"); pr_err("unexpect xfer type\n");
return -EINVAL; return -EINVAL;
} }
ep->type = info.type; ep->type = info.type;
...@@ -478,7 +478,7 @@ static int alloc_pipe_config(struct m66592_ep *ep, ...@@ -478,7 +478,7 @@ static int alloc_pipe_config(struct m66592_ep *ep,
ret = pipe_buffer_setting(m66592, &info); ret = pipe_buffer_setting(m66592, &info);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "pipe_buffer_setting fail\n"); pr_err("pipe_buffer_setting fail\n");
return ret; return ret;
} }
...@@ -614,7 +614,7 @@ static void start_ep0(struct m66592_ep *ep, struct m66592_request *req) ...@@ -614,7 +614,7 @@ static void start_ep0(struct m66592_ep *ep, struct m66592_request *req)
control_end(ep->m66592, 0); control_end(ep->m66592, 0);
break; break;
default: default:
printk(KERN_ERR "start_ep0: unexpect ctsq(%x)\n", ctsq); pr_err("start_ep0: unexpect ctsq(%x)\n", ctsq);
break; break;
} }
} }
...@@ -748,7 +748,7 @@ static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req) ...@@ -748,7 +748,7 @@ static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req)
do { do {
tmp = m66592_read(m66592, ep->fifoctr); tmp = m66592_read(m66592, ep->fifoctr);
if (i++ > 100000) { if (i++ > 100000) {
printk(KERN_ERR "pipe0 is busy. maybe cpu i/o bus " pr_err("pipe0 is busy. maybe cpu i/o bus "
"conflict. please power off this controller."); "conflict. please power off this controller.");
return; return;
} }
...@@ -798,7 +798,7 @@ static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req) ...@@ -798,7 +798,7 @@ static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req)
if (unlikely((tmp & M66592_FRDY) == 0)) { if (unlikely((tmp & M66592_FRDY) == 0)) {
pipe_stop(m66592, pipenum); pipe_stop(m66592, pipenum);
pipe_irq_disable(m66592, pipenum); pipe_irq_disable(m66592, pipenum);
printk(KERN_ERR "write fifo not ready. pipnum=%d\n", pipenum); pr_err("write fifo not ready. pipnum=%d\n", pipenum);
return; return;
} }
...@@ -847,7 +847,7 @@ static void irq_packet_read(struct m66592_ep *ep, struct m66592_request *req) ...@@ -847,7 +847,7 @@ static void irq_packet_read(struct m66592_ep *ep, struct m66592_request *req)
req->req.status = -EPIPE; req->req.status = -EPIPE;
pipe_stop(m66592, pipenum); pipe_stop(m66592, pipenum);
pipe_irq_disable(m66592, pipenum); pipe_irq_disable(m66592, pipenum);
printk(KERN_ERR "read fifo not ready"); pr_err("read fifo not ready");
return; return;
} }
...@@ -1102,7 +1102,7 @@ static void m66592_update_usb_speed(struct m66592 *m66592) ...@@ -1102,7 +1102,7 @@ static void m66592_update_usb_speed(struct m66592 *m66592)
break; break;
default: default:
m66592->gadget.speed = USB_SPEED_UNKNOWN; m66592->gadget.speed = USB_SPEED_UNKNOWN;
printk(KERN_ERR "USB speed unknown\n"); pr_err("USB speed unknown\n");
} }
} }
...@@ -1161,7 +1161,7 @@ __acquires(m66592->lock) ...@@ -1161,7 +1161,7 @@ __acquires(m66592->lock)
control_end(m66592, 0); control_end(m66592, 0);
break; break;
default: default:
printk(KERN_ERR "ctrl_stage: unexpect ctsq(%x)\n", ctsq); pr_err("ctrl_stage: unexpect ctsq(%x)\n", ctsq);
break; break;
} }
} }
...@@ -1461,13 +1461,13 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) ...@@ -1461,13 +1461,13 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
retval = device_add(&m66592->gadget.dev); retval = device_add(&m66592->gadget.dev);
if (retval) { if (retval) {
printk(KERN_ERR "device_add error (%d)\n", retval); pr_err("device_add error (%d)\n", retval);
goto error; goto error;
} }
retval = driver->bind (&m66592->gadget); retval = driver->bind (&m66592->gadget);
if (retval) { if (retval) {
printk(KERN_ERR "bind to driver error (%d)\n", retval); pr_err("bind to driver error (%d)\n", retval);
device_del(&m66592->gadget.dev); device_del(&m66592->gadget.dev);
goto error; goto error;
} }
...@@ -1561,28 +1561,28 @@ static int __init m66592_probe(struct platform_device *pdev) ...@@ -1561,28 +1561,28 @@ static int __init m66592_probe(struct platform_device *pdev)
(char *)udc_name); (char *)udc_name);
if (!res) { if (!res) {
ret = -ENODEV; ret = -ENODEV;
printk(KERN_ERR "platform_get_resource_byname error.\n"); pr_err("platform_get_resource_byname error.\n");
goto clean_up; goto clean_up;
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
ret = -ENODEV; ret = -ENODEV;
printk(KERN_ERR "platform_get_irq error.\n"); pr_err("platform_get_irq error.\n");
goto clean_up; goto clean_up;
} }
reg = ioremap(res->start, resource_len(res)); reg = ioremap(res->start, resource_len(res));
if (reg == NULL) { if (reg == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
printk(KERN_ERR "ioremap error.\n"); pr_err("ioremap error.\n");
goto clean_up; goto clean_up;
} }
/* initialize ucd */ /* initialize ucd */
m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL);
if (m66592 == NULL) { if (m66592 == NULL) {
printk(KERN_ERR "kzalloc error\n"); pr_err("kzalloc error\n");
goto clean_up; goto clean_up;
} }
...@@ -1608,7 +1608,7 @@ static int __init m66592_probe(struct platform_device *pdev) ...@@ -1608,7 +1608,7 @@ static int __init m66592_probe(struct platform_device *pdev)
ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED, ret = request_irq(irq, m66592_irq, IRQF_DISABLED | IRQF_SHARED,
udc_name, m66592); udc_name, m66592);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "request_irq error (%d)\n", ret); pr_err("request_irq error (%d)\n", ret);
goto clean_up; goto clean_up;
} }
......
...@@ -182,21 +182,16 @@ struct omap_udc { ...@@ -182,21 +182,16 @@ struct omap_udc {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifdef DEBUG
#define DBG(stuff...) printk(KERN_DEBUG "udc: " stuff)
#else
#define DBG(stuff...) do{}while(0)
#endif
#ifdef VERBOSE #ifdef VERBOSE
# define VDBG DBG # define VDBG DBG
#else #else
# define VDBG(stuff...) do{}while(0) # define VDBG(stuff...) do{}while(0)
#endif #endif
#define ERR(stuff...) printk(KERN_ERR "udc: " stuff) #define ERR(stuff...) pr_err("udc: " stuff)
#define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) #define WARN(stuff...) pr_warning("udc: " stuff)
#define INFO(stuff...) printk(KERN_INFO "udc: " stuff) #define INFO(stuff...) pr_info("udc: " stuff)
#define DBG(stuff...) pr_debug("udc: " stuff)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
...@@ -2099,7 +2099,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2099,7 +2099,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
/* insist on Intel/ARM/XScale */ /* insist on Intel/ARM/XScale */
asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
printk(KERN_ERR "%s: not XScale!\n", driver_name); pr_err("%s: not XScale!\n", driver_name);
return -ENODEV; return -ENODEV;
} }
...@@ -2128,7 +2128,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2128,7 +2128,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
break; break;
#endif #endif
default: default:
printk(KERN_ERR "%s: unrecognized processor: %08x\n", pr_err("%s: unrecognized processor: %08x\n",
driver_name, chiprev); driver_name, chiprev);
/* iop3xx, ixp4xx, ... */ /* iop3xx, ixp4xx, ... */
return -ENODEV; return -ENODEV;
...@@ -2199,7 +2199,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2199,7 +2199,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
retval = request_irq(irq, pxa2xx_udc_irq, retval = request_irq(irq, pxa2xx_udc_irq,
IRQF_DISABLED, driver_name, dev); IRQF_DISABLED, driver_name, dev);
if (retval != 0) { if (retval != 0) {
printk(KERN_ERR "%s: can't get irq %d, err %d\n", pr_err("%s: can't get irq %d, err %d\n",
driver_name, irq, retval); driver_name, irq, retval);
goto err_irq1; goto err_irq1;
} }
...@@ -2212,7 +2212,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2212,7 +2212,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
IRQF_DISABLED | IRQF_SAMPLE_RANDOM, IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
driver_name, dev); driver_name, dev);
if (retval != 0) { if (retval != 0) {
printk(KERN_ERR "%s: can't get irq %i, err %d\n", pr_err("%s: can't get irq %i, err %d\n",
driver_name, LUBBOCK_USB_DISC_IRQ, retval); driver_name, LUBBOCK_USB_DISC_IRQ, retval);
lubbock_fail0: lubbock_fail0:
goto err_irq_lub; goto err_irq_lub;
...@@ -2222,7 +2222,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2222,7 +2222,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
IRQF_DISABLED | IRQF_SAMPLE_RANDOM, IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
driver_name, dev); driver_name, dev);
if (retval != 0) { if (retval != 0) {
printk(KERN_ERR "%s: can't get irq %i, err %d\n", pr_err("%s: can't get irq %i, err %d\n",
driver_name, LUBBOCK_USB_IRQ, retval); driver_name, LUBBOCK_USB_IRQ, retval);
free_irq(LUBBOCK_USB_DISC_IRQ, dev); free_irq(LUBBOCK_USB_DISC_IRQ, dev);
goto lubbock_fail0; goto lubbock_fail0;
...@@ -2235,7 +2235,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev) ...@@ -2235,7 +2235,7 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
driver_name, dev); driver_name, dev);
if (retval != 0) { if (retval != 0) {
printk(KERN_ERR "%s: can't get irq %i, err %d\n", pr_err("%s: can't get irq %i, err %d\n",
driver_name, vbus_irq, retval); driver_name, vbus_irq, retval);
goto err_vbus_irq; goto err_vbus_irq;
} }
...@@ -2361,7 +2361,7 @@ static struct platform_driver udc_driver = { ...@@ -2361,7 +2361,7 @@ static struct platform_driver udc_driver = {
static int __init udc_init(void) static int __init udc_init(void)
{ {
printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
return platform_driver_probe(&udc_driver, pxa2xx_udc_probe); return platform_driver_probe(&udc_driver, pxa2xx_udc_probe);
} }
module_init(udc_init); module_init(udc_init);
......
...@@ -151,6 +151,8 @@ static struct pxa2xx_udc *the_controller; ...@@ -151,6 +151,8 @@ static struct pxa2xx_udc *the_controller;
#define DBG_NOISY 3 /* ... even more: request level */ #define DBG_NOISY 3 /* ... even more: request level */
#define DBG_VERY_NOISY 4 /* ... even more: packet level */ #define DBG_VERY_NOISY 4 /* ... even more: packet level */
#define DMSG(stuff...) pr_debug("udc: " stuff)
#ifdef DEBUG #ifdef DEBUG
static const char *state_name[] = { static const char *state_name[] = {
...@@ -159,8 +161,6 @@ static const char *state_name[] = { ...@@ -159,8 +161,6 @@ static const char *state_name[] = {
"EP0_END_XFER", "EP0_STALL" "EP0_END_XFER", "EP0_STALL"
}; };
#define DMSG(stuff...) printk(KERN_DEBUG "udc: " stuff)
#ifdef VERBOSE #ifdef VERBOSE
# define UDC_DEBUG DBG_VERBOSE # define UDC_DEBUG DBG_VERBOSE
#else #else
...@@ -241,8 +241,6 @@ dump_state(struct pxa2xx_udc *dev) ...@@ -241,8 +241,6 @@ dump_state(struct pxa2xx_udc *dev)
#else #else
#define DMSG(stuff...) do{}while(0)
#define dump_udccr(x) do{}while(0) #define dump_udccr(x) do{}while(0)
#define dump_udccs0(x) do{}while(0) #define dump_udccs0(x) do{}while(0)
#define dump_state(x) do{}while(0) #define dump_state(x) do{}while(0)
...@@ -253,8 +251,9 @@ dump_state(struct pxa2xx_udc *dev) ...@@ -253,8 +251,9 @@ dump_state(struct pxa2xx_udc *dev)
#define DBG(lvl, stuff...) do{if ((lvl) <= UDC_DEBUG) DMSG(stuff);}while(0) #define DBG(lvl, stuff...) do{if ((lvl) <= UDC_DEBUG) DMSG(stuff);}while(0)
#define WARN(stuff...) printk(KERN_WARNING "udc: " stuff) #define ERR(stuff...) pr_err("udc: " stuff)
#define INFO(stuff...) printk(KERN_INFO "udc: " stuff) #define WARN(stuff...) pr_warning("udc: " stuff)
#define INFO(stuff...) pr_info("udc: " stuff)
#endif /* __LINUX_USB_GADGET_PXA2XX_H */ #endif /* __LINUX_USB_GADGET_PXA2XX_H */
...@@ -53,21 +53,18 @@ ...@@ -53,21 +53,18 @@
*/ */
#if 0 #if 0
#define DBG(str,args...) do { \
if (rndis_debug) \
printk(KERN_DEBUG str , ## args ); \
} while (0)
static int rndis_debug = 0; static int rndis_debug = 0;
module_param (rndis_debug, int, 0); module_param (rndis_debug, int, 0);
MODULE_PARM_DESC (rndis_debug, "enable debugging"); MODULE_PARM_DESC (rndis_debug, "enable debugging");
#else #else
#define rndis_debug 0 #define rndis_debug 0
#define DBG(str,args...) do{}while(0)
#endif #endif
#define DBG(str,args...) do { \
if (rndis_debug) \
pr_debug(str , ## args); \
} while (0)
#define RNDIS_MAX_CONFIGS 1 #define RNDIS_MAX_CONFIGS 1
...@@ -679,7 +676,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -679,7 +676,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
#endif #endif
default: default:
printk (KERN_WARNING "%s: query unknown OID 0x%08X\n", pr_warning("%s: query unknown OID 0x%08X\n",
__FUNCTION__, OID); __FUNCTION__, OID);
} }
if (retval < 0) if (retval < 0)
...@@ -804,7 +801,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, ...@@ -804,7 +801,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
#endif /* RNDIS_PM */ #endif /* RNDIS_PM */
default: default:
printk (KERN_WARNING "%s: set unknown OID 0x%08X, size %d\n", pr_warning("%s: set unknown OID 0x%08X, size %d\n",
__FUNCTION__, OID, buf_len); __FUNCTION__, OID, buf_len);
} }
...@@ -1126,8 +1123,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf) ...@@ -1126,8 +1123,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
* In one case those messages seemed to relate to the host * In one case those messages seemed to relate to the host
* suspending itself. * suspending itself.
*/ */
printk (KERN_WARNING pr_warning("%s: unknown RNDIS message 0x%08X len %d\n",
"%s: unknown RNDIS message 0x%08X len %d\n",
__FUNCTION__ , MsgType, MsgLength); __FUNCTION__ , MsgType, MsgLength);
{ {
unsigned i; unsigned i;
......
This diff is collapsed.
...@@ -1115,7 +1115,7 @@ zero_bind (struct usb_gadget *gadget) ...@@ -1115,7 +1115,7 @@ zero_bind (struct usb_gadget *gadget)
ep = usb_ep_autoconfig (gadget, &fs_source_desc); ep = usb_ep_autoconfig (gadget, &fs_source_desc);
if (!ep) { if (!ep) {
autoconf_fail: autoconf_fail:
printk (KERN_ERR "%s: can't autoconfigure on %s\n", pr_err("%s: can't autoconfigure on %s\n",
shortname, gadget->name); shortname, gadget->name);
return -ENODEV; return -ENODEV;
} }
...@@ -1139,7 +1139,7 @@ zero_bind (struct usb_gadget *gadget) ...@@ -1139,7 +1139,7 @@ zero_bind (struct usb_gadget *gadget)
* things like configuration and altsetting numbering * things like configuration and altsetting numbering
* can need hardware-specific attention though. * can need hardware-specific attention though.
*/ */
printk (KERN_WARNING "%s: controller '%s' not recognized\n", pr_warning("%s: controller '%s' not recognized\n",
shortname, gadget->name); shortname, gadget->name);
device_desc.bcdDevice = __constant_cpu_to_le16 (0x9999); device_desc.bcdDevice = __constant_cpu_to_le16 (0x9999);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment