Commit 9f857ae922a08a94fe41a649c2d0baa73cd74d2a

Authored by Greg Kroah-Hartman
1 parent f73e1ffa27

USB: ir-usb.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the ir-usb.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Johan Hovold <jhovold@gmail.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 28 additions and 22 deletions Side-by-side Diff

drivers/usb/serial/ir-usb.c
... ... @@ -96,18 +96,21 @@
96 96 &ir_device, NULL
97 97 };
98 98  
99   -static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc)
  99 +static inline void irda_usb_dump_class_desc(struct usb_serial *serial,
  100 + struct usb_irda_cs_descriptor *desc)
100 101 {
101   - dbg("bLength=%x", desc->bLength);
102   - dbg("bDescriptorType=%x", desc->bDescriptorType);
103   - dbg("bcdSpecRevision=%x", __le16_to_cpu(desc->bcdSpecRevision));
104   - dbg("bmDataSize=%x", desc->bmDataSize);
105   - dbg("bmWindowSize=%x", desc->bmWindowSize);
106   - dbg("bmMinTurnaroundTime=%d", desc->bmMinTurnaroundTime);
107   - dbg("wBaudRate=%x", __le16_to_cpu(desc->wBaudRate));
108   - dbg("bmAdditionalBOFs=%x", desc->bmAdditionalBOFs);
109   - dbg("bIrdaRateSniff=%x", desc->bIrdaRateSniff);
110   - dbg("bMaxUnicastList=%x", desc->bMaxUnicastList);
  102 + struct device *dev = &serial->dev->dev;
  103 +
  104 + dev_dbg(dev, "bLength=%x\n", desc->bLength);
  105 + dev_dbg(dev, "bDescriptorType=%x\n", desc->bDescriptorType);
  106 + dev_dbg(dev, "bcdSpecRevision=%x\n", __le16_to_cpu(desc->bcdSpecRevision));
  107 + dev_dbg(dev, "bmDataSize=%x\n", desc->bmDataSize);
  108 + dev_dbg(dev, "bmWindowSize=%x\n", desc->bmWindowSize);
  109 + dev_dbg(dev, "bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime);
  110 + dev_dbg(dev, "wBaudRate=%x\n", __le16_to_cpu(desc->wBaudRate));
  111 + dev_dbg(dev, "bmAdditionalBOFs=%x\n", desc->bmAdditionalBOFs);
  112 + dev_dbg(dev, "bIrdaRateSniff=%x\n", desc->bIrdaRateSniff);
  113 + dev_dbg(dev, "bMaxUnicastList=%x\n", desc->bMaxUnicastList);
111 114 }
112 115  
113 116 /*------------------------------------------------------------------*/
114 117  
... ... @@ -123,8 +126,9 @@
123 126 * Based on the same function in drivers/net/irda/irda-usb.c
124 127 */
125 128 static struct usb_irda_cs_descriptor *
126   -irda_usb_find_class_desc(struct usb_device *dev, unsigned int ifnum)
  129 +irda_usb_find_class_desc(struct usb_serial *serial, unsigned int ifnum)
127 130 {
  131 + struct usb_device *dev = serial->dev;
128 132 struct usb_irda_cs_descriptor *desc;
129 133 int ret;
130 134  
131 135  
132 136  
133 137  
... ... @@ -137,20 +141,20 @@
137 141 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
138 142 0, ifnum, desc, sizeof(*desc), 1000);
139 143  
140   - dbg("%s - ret=%d", __func__, ret);
  144 + dev_dbg(&serial->dev->dev, "%s - ret=%d\n", __func__, ret);
141 145 if (ret < sizeof(*desc)) {
142   - dbg("%s - class descriptor read %s (%d)",
143   - __func__,
144   - (ret < 0) ? "failed" : "too short",
145   - ret);
  146 + dev_dbg(&serial->dev->dev,
  147 + "%s - class descriptor read %s (%d)\n", __func__,
  148 + (ret < 0) ? "failed" : "too short", ret);
146 149 goto error;
147 150 }
148 151 if (desc->bDescriptorType != USB_DT_CS_IRDA) {
149   - dbg("%s - bad class descriptor type", __func__);
  152 + dev_dbg(&serial->dev->dev, "%s - bad class descriptor type\n",
  153 + __func__);
150 154 goto error;
151 155 }
152 156  
153   - irda_usb_dump_class_desc(desc);
  157 + irda_usb_dump_class_desc(serial, desc);
154 158 return desc;
155 159  
156 160 error:
157 161  
... ... @@ -200,14 +204,15 @@
200 204 {
201 205 struct usb_irda_cs_descriptor *irda_desc;
202 206  
203   - irda_desc = irda_usb_find_class_desc(serial->dev, 0);
  207 + irda_desc = irda_usb_find_class_desc(serial, 0);
204 208 if (!irda_desc) {
205 209 dev_err(&serial->dev->dev,
206 210 "IRDA class descriptor not found, device not bound\n");
207 211 return -ENODEV;
208 212 }
209 213  
210   - dbg("%s - Baud rates supported:%s%s%s%s%s%s%s%s%s",
  214 + dev_dbg(&serial->dev->dev,
  215 + "%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n",
211 216 __func__,
212 217 (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "",
213 218 (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "",
... ... @@ -316,7 +321,8 @@
316 321 kfree(urb->transfer_buffer);
317 322  
318 323 if (urb->status)
319   - dbg("%s - non-zero urb status: %d", __func__, urb->status);
  324 + dev_dbg(&urb->dev->dev, "%s - non-zero urb status: %d\n",
  325 + __func__, urb->status);
320 326 }
321 327  
322 328 static void ir_set_termios(struct tty_struct *tty,