aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-19 18:42:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-21 19:01:00 -0500
commit3482528e9aced9234d4e2a4a9538c882a9aa5aa2 (patch)
tree18cd72ca919471c1d7db536965ea32ce329d4e77 /drivers/usb/core
parent0c8b1992b4a180704a887b3c9128aa103b5ef60f (diff)
USB: core: remove CONFIG_USB_DEBUG usage
CONFIG_USB_DEBUG is going away, so remove the few places in the USB core that relied on them. This means that we always now do the "debug" checks for every urb submitted, which is a good idea, as who knows how many driver bugs we have been ignoring when people forget to enable this option. Also, with the overall speed of USB, doing these extra checks should not cause any additional overhead. Also, no longer announce all devices being added to the system if CONFIG_USB_DEBUG is enabled, as it's not going to be around much longer. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/Makefile2
-rw-r--r--drivers/usb/core/hub.c7
-rw-r--r--drivers/usb/core/urb.c16
3 files changed, 7 insertions, 18 deletions
diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile
index 5e847ad2f58a..2f6f93220046 100644
--- a/drivers/usb/core/Makefile
+++ b/drivers/usb/core/Makefile
@@ -2,8 +2,6 @@
2# Makefile for USB Core files and filesystem 2# Makefile for USB Core files and filesystem
3# 3#
4 4
5ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
6
7usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o 5usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
8usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o 6usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
9usbcore-y += devio.o notify.o generic.o quirks.o devices.o 7usbcore-y += devio.o notify.o generic.o quirks.o devices.o
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 162e94dbed53..92e052db27ac 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -33,13 +33,6 @@
33 33
34#include "hub.h" 34#include "hub.h"
35 35
36/* if we are in debug mode, always announce new devices */
37#ifdef DEBUG
38#ifndef CONFIG_USB_ANNOUNCE_NEW_DEVICES
39#define CONFIG_USB_ANNOUNCE_NEW_DEVICES
40#endif
41#endif
42
43#define USB_VENDOR_GENESYS_LOGIC 0x05e3 36#define USB_VENDOR_GENESYS_LOGIC 0x05e3
44#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 37#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
45 38
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 07c58af6b5c0..f4cb7fc1c929 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -325,10 +325,14 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb);
325 */ 325 */
326int usb_submit_urb(struct urb *urb, gfp_t mem_flags) 326int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
327{ 327{
328 static int pipetypes[4] = {
329 PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT
330 };
328 int xfertype, max; 331 int xfertype, max;
329 struct usb_device *dev; 332 struct usb_device *dev;
330 struct usb_host_endpoint *ep; 333 struct usb_host_endpoint *ep;
331 int is_out; 334 int is_out;
335 unsigned int allowed;
332 336
333 if (!urb || !urb->complete) 337 if (!urb || !urb->complete)
334 return -EINVAL; 338 return -EINVAL;
@@ -436,15 +440,10 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
436 if (urb->transfer_buffer_length > INT_MAX) 440 if (urb->transfer_buffer_length > INT_MAX)
437 return -EMSGSIZE; 441 return -EMSGSIZE;
438 442
439#ifdef DEBUG 443 /*
440 /* stuff that drivers shouldn't do, but which shouldn't 444 * stuff that drivers shouldn't do, but which shouldn't
441 * cause problems in HCDs if they get it wrong. 445 * cause problems in HCDs if they get it wrong.
442 */ 446 */
443 {
444 unsigned int allowed;
445 static int pipetypes[4] = {
446 PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT
447 };
448 447
449 /* Check that the pipe's type matches the endpoint's type */ 448 /* Check that the pipe's type matches the endpoint's type */
450 if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) 449 if (usb_pipetype(urb->pipe) != pipetypes[xfertype])
@@ -476,8 +475,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
476 if (allowed != urb->transfer_flags) 475 if (allowed != urb->transfer_flags)
477 dev_WARN(&dev->dev, "BOGUS urb flags, %x --> %x\n", 476 dev_WARN(&dev->dev, "BOGUS urb flags, %x --> %x\n",
478 urb->transfer_flags, allowed); 477 urb->transfer_flags, allowed);
479 } 478
480#endif
481 /* 479 /*
482 * Force periodic transfer intervals to be legal values that are 480 * Force periodic transfer intervals to be legal values that are
483 * a power of two (so HCDs don't need to). 481 * a power of two (so HCDs don't need to).