Commit 457163c4c7c69ee7f92c31bd48be332316824a14
1 parent
3b2f64d00c
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
USB: ldusb: remove custom dbg_info() macro
We want to get rid of CONFIG_USB_DEBUG, so remove the reliance of the ldusb driver on it. Don't use the custom macro, or a special module parameter, instead, rely on the in-kernel dynamic debugging infrastructure, which is much easier to use, and consistant across the whole kernel. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 10 additions and 21 deletions Side-by-side Diff
drivers/usb/misc/ldusb.c
... | ... | @@ -129,19 +129,6 @@ |
129 | 129 | MODULE_LICENSE("GPL"); |
130 | 130 | MODULE_SUPPORTED_DEVICE("LD USB Devices"); |
131 | 131 | |
132 | -#ifdef CONFIG_USB_DEBUG | |
133 | - static int debug = 1; | |
134 | -#else | |
135 | - static int debug = 0; | |
136 | -#endif | |
137 | - | |
138 | -/* Use our own dbg macro */ | |
139 | -#define dbg_info(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0) | |
140 | - | |
141 | -/* Module parameters */ | |
142 | -module_param(debug, int, S_IRUGO | S_IWUSR); | |
143 | -MODULE_PARM_DESC(debug, "Debug enabled or not"); | |
144 | - | |
145 | 132 | /* All interrupt in transfers are collected in a ring buffer to |
146 | 133 | * avoid racing conditions and get better performance of the driver. |
147 | 134 | */ |
... | ... | @@ -256,8 +243,9 @@ |
256 | 243 | status == -ESHUTDOWN) { |
257 | 244 | goto exit; |
258 | 245 | } else { |
259 | - dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n", | |
260 | - __func__, status); | |
246 | + dev_dbg(&dev->intf->dev, | |
247 | + "%s: nonzero status received: %d\n", __func__, | |
248 | + status); | |
261 | 249 | spin_lock(&dev->rbsl); |
262 | 250 | goto resubmit; /* maybe we can recover */ |
263 | 251 | } |
... | ... | @@ -272,8 +260,8 @@ |
272 | 260 | *actual_buffer = urb->actual_length; |
273 | 261 | memcpy(actual_buffer+1, dev->interrupt_in_buffer, urb->actual_length); |
274 | 262 | dev->ring_head = next_ring_head; |
275 | - dbg_info(&dev->intf->dev, "%s: received %d bytes\n", | |
276 | - __func__, urb->actual_length); | |
263 | + dev_dbg(&dev->intf->dev, "%s: received %d bytes\n", | |
264 | + __func__, urb->actual_length); | |
277 | 265 | } else { |
278 | 266 | dev_warn(&dev->intf->dev, |
279 | 267 | "Ring buffer overflow, %d bytes dropped\n", |
... | ... | @@ -310,9 +298,9 @@ |
310 | 298 | if (status && !(status == -ENOENT || |
311 | 299 | status == -ECONNRESET || |
312 | 300 | status == -ESHUTDOWN)) |
313 | - dbg_info(&dev->intf->dev, | |
314 | - "%s - nonzero write interrupt status received: %d\n", | |
315 | - __func__, status); | |
301 | + dev_dbg(&dev->intf->dev, | |
302 | + "%s - nonzero write interrupt status received: %d\n", | |
303 | + __func__, status); | |
316 | 304 | |
317 | 305 | dev->interrupt_out_busy = 0; |
318 | 306 | wake_up_interruptible(&dev->write_wait); |
... | ... | @@ -585,7 +573,8 @@ |
585 | 573 | bytes_to_write = min(count, write_buffer_size*dev->interrupt_out_endpoint_size); |
586 | 574 | if (bytes_to_write < count) |
587 | 575 | dev_warn(&dev->intf->dev, "Write buffer overflow, %zd bytes dropped\n",count-bytes_to_write); |
588 | - dbg_info(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n", __func__, count, bytes_to_write); | |
576 | + dev_dbg(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n", | |
577 | + __func__, count, bytes_to_write); | |
589 | 578 | |
590 | 579 | if (copy_from_user(dev->interrupt_out_buffer, buffer, bytes_to_write)) { |
591 | 580 | retval = -EFAULT; |