Commit b9cef6c3 authored by Wu Fengguang's avatar Wu Fengguang Committed by Greg Kroah-Hartman

USB: make printk messages more searchable

USB: make printk messages more searchable

Make USB printk messages long and straightforward.  One of these
decorated USB error messages cost me non-trivial efforts to locate.
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e22b582e
...@@ -107,7 +107,9 @@ MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs"); ...@@ -107,7 +107,9 @@ MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs");
/* define initial 64-byte descriptor request timeout in milliseconds */ /* define initial 64-byte descriptor request timeout in milliseconds */
static int initial_descriptor_timeout = USB_CTRL_GET_TIMEOUT; static int initial_descriptor_timeout = USB_CTRL_GET_TIMEOUT;
module_param(initial_descriptor_timeout, int, S_IRUGO|S_IWUSR); module_param(initial_descriptor_timeout, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(initial_descriptor_timeout, "initial 64-byte descriptor request timeout in milliseconds (default 5000 - 5.0 seconds)"); MODULE_PARM_DESC(initial_descriptor_timeout,
"initial 64-byte descriptor request timeout in milliseconds "
"(default 5000 - 5.0 seconds)");
/* /*
* As of 2.6.10 we introduce a new USB device initialization scheme which * As of 2.6.10 we introduce a new USB device initialization scheme which
...@@ -1136,8 +1138,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1136,8 +1138,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
hdev = interface_to_usbdev(intf); hdev = interface_to_usbdev(intf);
if (hdev->level == MAX_TOPO_LEVEL) { if (hdev->level == MAX_TOPO_LEVEL) {
dev_err(&intf->dev, "Unsupported bus topology: " dev_err(&intf->dev,
"hub nested too deep\n"); "Unsupported bus topology: hub nested too deep\n");
return -E2BIG; return -E2BIG;
} }
...@@ -1477,8 +1479,8 @@ static void announce_device(struct usb_device *udev) ...@@ -1477,8 +1479,8 @@ static void announce_device(struct usb_device *udev)
dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n", dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n",
le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct)); le16_to_cpu(udev->descriptor.idProduct));
dev_info(&udev->dev, "New USB device strings: Mfr=%d, Product=%d, " dev_info(&udev->dev,
"SerialNumber=%d\n", "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
udev->descriptor.iManufacturer, udev->descriptor.iManufacturer,
udev->descriptor.iProduct, udev->descriptor.iProduct,
udev->descriptor.iSerialNumber); udev->descriptor.iSerialNumber);
...@@ -1543,7 +1545,7 @@ static int usb_configure_device_otg(struct usb_device *udev) ...@@ -1543,7 +1545,7 @@ static int usb_configure_device_otg(struct usb_device *udev)
* customize to match your product. * customize to match your product.
*/ */
dev_info(&udev->dev, dev_info(&udev->dev,
"can't set HNP mode; %d\n", "can't set HNP mode: %d\n",
err); err);
bus->b_hnp_enable = 0; bus->b_hnp_enable = 0;
} }
...@@ -2047,8 +2049,8 @@ static int finish_port_resume(struct usb_device *udev) ...@@ -2047,8 +2049,8 @@ static int finish_port_resume(struct usb_device *udev)
u16 devstatus; u16 devstatus;
/* caller owns the udev device lock */ /* caller owns the udev device lock */
dev_dbg(&udev->dev, "finish %sresume\n", dev_dbg(&udev->dev, "%s\n",
udev->reset_resume ? "reset-" : ""); udev->reset_resume ? "finish reset-resume" : "finish resume");
/* usb ch9 identifies four variants of SUSPENDED, based on what /* usb ch9 identifies four variants of SUSPENDED, based on what
* state the device resumes to. Linux currently won't see the * state the device resumes to. Linux currently won't see the
...@@ -2100,8 +2102,9 @@ static int finish_port_resume(struct usb_device *udev) ...@@ -2100,8 +2102,9 @@ static int finish_port_resume(struct usb_device *udev)
NULL, 0, NULL, 0,
USB_CTRL_SET_TIMEOUT); USB_CTRL_SET_TIMEOUT);
if (status) if (status)
dev_dbg(&udev->dev, "disable remote " dev_dbg(&udev->dev,
"wakeup, status %d\n", status); "disable remote wakeup, status %d\n",
status);
} }
status = 0; status = 0;
} }
...@@ -2584,9 +2587,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -2584,9 +2587,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
goto fail; goto fail;
} }
if (r) { if (r) {
dev_err(&udev->dev, "device descriptor " dev_err(&udev->dev,
"read/%s, error %d\n", "device descriptor read/64, error %d\n",
"64", r); r);
retval = -EMSGSIZE; retval = -EMSGSIZE;
continue; continue;
} }
...@@ -2623,9 +2626,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -2623,9 +2626,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
retval = usb_get_device_descriptor(udev, 8); retval = usb_get_device_descriptor(udev, 8);
if (retval < 8) { if (retval < 8) {
dev_err(&udev->dev, "device descriptor " dev_err(&udev->dev,
"read/%s, error %d\n", "device descriptor read/8, error %d\n",
"8", retval); retval);
if (retval >= 0) if (retval >= 0)
retval = -EMSGSIZE; retval = -EMSGSIZE;
} else { } else {
...@@ -2652,8 +2655,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -2652,8 +2655,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE); retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE);
if (retval < (signed)sizeof(udev->descriptor)) { if (retval < (signed)sizeof(udev->descriptor)) {
dev_err(&udev->dev, "device descriptor read/%s, error %d\n", dev_err(&udev->dev, "device descriptor read/all, error %d\n",
"all", retval); retval);
if (retval >= 0) if (retval >= 0)
retval = -ENOMSG; retval = -ENOMSG;
goto fail; goto fail;
...@@ -2721,9 +2724,9 @@ hub_power_remaining (struct usb_hub *hub) ...@@ -2721,9 +2724,9 @@ hub_power_remaining (struct usb_hub *hub)
else else
delta = 8; delta = 8;
if (delta > hub->mA_per_port) if (delta > hub->mA_per_port)
dev_warn(&udev->dev, "%dmA is over %umA budget " dev_warn(&udev->dev,
"for port %d!\n", "%dmA is over %umA budget for port %d!\n",
delta, hub->mA_per_port, port1); delta, hub->mA_per_port, port1);
remaining -= delta; remaining -= delta;
} }
if (remaining < 0) { if (remaining < 0) {
......
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