diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-15 19:27:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-15 19:27:23 -0400 |
commit | 9f857ae922a08a94fe41a649c2d0baa73cd74d2a (patch) | |
tree | d634d52622bb4529e61cd63b436dc6d922f3867d /drivers/usb/serial/ir-usb.c | |
parent | f73e1ffa27434772f57a9a7daaa508d06c56fddf (diff) |
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>
Diffstat (limited to 'drivers/usb/serial/ir-usb.c')
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index e9f8e1916f07..fc09414c960f 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -96,18 +96,21 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
96 | &ir_device, NULL | 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 | struct device *dev = &serial->dev->dev; |
102 | dbg("bDescriptorType=%x", desc->bDescriptorType); | 103 | |
103 | dbg("bcdSpecRevision=%x", __le16_to_cpu(desc->bcdSpecRevision)); | 104 | dev_dbg(dev, "bLength=%x\n", desc->bLength); |
104 | dbg("bmDataSize=%x", desc->bmDataSize); | 105 | dev_dbg(dev, "bDescriptorType=%x\n", desc->bDescriptorType); |
105 | dbg("bmWindowSize=%x", desc->bmWindowSize); | 106 | dev_dbg(dev, "bcdSpecRevision=%x\n", __le16_to_cpu(desc->bcdSpecRevision)); |
106 | dbg("bmMinTurnaroundTime=%d", desc->bmMinTurnaroundTime); | 107 | dev_dbg(dev, "bmDataSize=%x\n", desc->bmDataSize); |
107 | dbg("wBaudRate=%x", __le16_to_cpu(desc->wBaudRate)); | 108 | dev_dbg(dev, "bmWindowSize=%x\n", desc->bmWindowSize); |
108 | dbg("bmAdditionalBOFs=%x", desc->bmAdditionalBOFs); | 109 | dev_dbg(dev, "bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime); |
109 | dbg("bIrdaRateSniff=%x", desc->bIrdaRateSniff); | 110 | dev_dbg(dev, "wBaudRate=%x\n", __le16_to_cpu(desc->wBaudRate)); |
110 | dbg("bMaxUnicastList=%x", desc->bMaxUnicastList); | 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 | /*------------------------------------------------------------------*/ |
@@ -123,8 +126,9 @@ static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc) | |||
123 | * Based on the same function in drivers/net/irda/irda-usb.c | 126 | * Based on the same function in drivers/net/irda/irda-usb.c |
124 | */ | 127 | */ |
125 | static struct usb_irda_cs_descriptor * | 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 | struct usb_irda_cs_descriptor *desc; | 132 | struct usb_irda_cs_descriptor *desc; |
129 | int ret; | 133 | int ret; |
130 | 134 | ||
@@ -137,20 +141,20 @@ irda_usb_find_class_desc(struct usb_device *dev, unsigned int ifnum) | |||
137 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | 141 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, |
138 | 0, ifnum, desc, sizeof(*desc), 1000); | 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 | if (ret < sizeof(*desc)) { | 145 | if (ret < sizeof(*desc)) { |
142 | dbg("%s - class descriptor read %s (%d)", | 146 | dev_dbg(&serial->dev->dev, |
143 | __func__, | 147 | "%s - class descriptor read %s (%d)\n", __func__, |
144 | (ret < 0) ? "failed" : "too short", | 148 | (ret < 0) ? "failed" : "too short", ret); |
145 | ret); | ||
146 | goto error; | 149 | goto error; |
147 | } | 150 | } |
148 | if (desc->bDescriptorType != USB_DT_CS_IRDA) { | 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 | goto error; | 154 | goto error; |
151 | } | 155 | } |
152 | 156 | ||
153 | irda_usb_dump_class_desc(desc); | 157 | irda_usb_dump_class_desc(serial, desc); |
154 | return desc; | 158 | return desc; |
155 | 159 | ||
156 | error: | 160 | error: |
@@ -200,14 +204,15 @@ static int ir_startup(struct usb_serial *serial) | |||
200 | { | 204 | { |
201 | struct usb_irda_cs_descriptor *irda_desc; | 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 | if (!irda_desc) { | 208 | if (!irda_desc) { |
205 | dev_err(&serial->dev->dev, | 209 | dev_err(&serial->dev->dev, |
206 | "IRDA class descriptor not found, device not bound\n"); | 210 | "IRDA class descriptor not found, device not bound\n"); |
207 | return -ENODEV; | 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 | __func__, | 216 | __func__, |
212 | (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "", | 217 | (irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "", |
213 | (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "", | 218 | (irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "", |
@@ -316,7 +321,8 @@ static void ir_set_termios_callback(struct urb *urb) | |||
316 | kfree(urb->transfer_buffer); | 321 | kfree(urb->transfer_buffer); |
317 | 322 | ||
318 | if (urb->status) | 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 | static void ir_set_termios(struct tty_struct *tty, | 328 | static void ir_set_termios(struct tty_struct *tty, |