Commit 0907edc2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: convert more dbg() calls to dev_dbg for the usb core

parent 0d404451
......@@ -346,7 +346,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */
case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
case DeviceOutRequest | USB_REQ_SET_FEATURE:
dbg ("no device features yet yet");
dev_dbg (*hcd->controller, "no device features yet yet\n");
break;
case DeviceRequest | USB_REQ_GET_CONFIGURATION:
ubuf [0] = 1;
......@@ -404,7 +404,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */
case EndpointOutRequest | USB_REQ_CLEAR_FEATURE:
case EndpointOutRequest | USB_REQ_SET_FEATURE:
dbg ("no endpoint features yet");
dev_dbg (*hcd->controller, "no endpoint features yet\n");
break;
/* CLASS REQUESTS (and errors) */
......@@ -418,12 +418,12 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
error:
/* "protocol stall" on error */
urb->status = -EPIPE;
dbg ("unsupported hub control message (maxchild %d)",
dev_dbg (*hcd->controller, "unsupported hub control message (maxchild %d)\n",
urb->dev->maxchild);
}
if (urb->status) {
urb->actual_length = 0;
dbg ("CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d",
dev_dbg (*hcd->controller, "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n",
typeReq, wValue, wIndex, wLength, urb->status);
}
if (bufp) {
......@@ -456,7 +456,7 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb)
if (timer_pending (&hcd->rh_timer)
|| urb->status != -EINPROGRESS
|| urb->transfer_buffer_length < len) {
dbg ("not queuing status urb, stat %d", urb->status);
dev_dbg (*hcd->controller, "not queuing status urb, stat %d\n", urb->status);
return -EINVAL;
}
......@@ -667,7 +667,7 @@ void usb_register_bus(struct usb_bus *bus)
usbfs_add_bus (bus);
info ("new USB bus registered, assigned bus number %d", bus->busnum);
dev_info (*bus->controller, "new USB bus registered, assigned bus number %d\n", bus->busnum);
}
EXPORT_SYMBOL (usb_register_bus);
......@@ -681,7 +681,7 @@ EXPORT_SYMBOL (usb_register_bus);
*/
void usb_deregister_bus (struct usb_bus *bus)
{
info ("USB bus %d deregistered", bus->busnum);
dev_info (*bus->controller, "USB bus %d deregistered\n", bus->busnum);
/*
* NOTE: make sure that all the devices are removed by the
......@@ -824,7 +824,7 @@ int usb_check_bandwidth (struct usb_device *dev, struct urb *urb)
#else
"would have ";
#endif
dbg ("usb_check_bandwidth %sFAILED: %d + %ld = %d usec",
dev_dbg (dev->dev, "usb_check_bandwidth %sFAILED: %d + %ld = %d usec\n",
mode, old_alloc, bustime, new_alloc);
#endif
#ifdef CONFIG_USB_BANDWIDTH
......@@ -863,7 +863,7 @@ void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, int bustime,
urb->bandwidth = bustime;
#ifdef USB_BANDWIDTH_MESSAGES
dbg ("bandwidth alloc increased by %d (%s) to %d for %d requesters",
dev_dbg (dev->dev, "bandwidth alloc increased by %d (%s) to %d for %d requesters\n",
bustime,
isoc ? "ISOC" : "INTR",
dev->bus->bandwidth_allocated,
......@@ -892,7 +892,7 @@ void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, int isoc)
dev->bus->bandwidth_int_reqs--;
#ifdef USB_BANDWIDTH_MESSAGES
dbg ("bandwidth alloc reduced by %d (%s) to %d for %d requesters",
dev_dbg (dev->dev, "bandwidth alloc reduced by %d (%s) to %d for %d requesters\n",
urb->bandwidth,
isoc ? "ISOC" : "INTR",
dev->bus->bandwidth_allocated,
......@@ -1153,7 +1153,7 @@ static int hcd_unlink_urb (struct urb *urb)
*/
if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
if (in_interrupt ()) {
dbg ("non-async unlink in_interrupt");
dev_dbg (*hcd->controller, "non-async unlink in_interrupt");
retval = -EWOULDBLOCK;
goto done;
}
......@@ -1233,7 +1233,7 @@ static int hcd_free_dev (struct usb_device *udev)
/* device driver problem with refcounts? */
if (!list_empty (&dev->urb_list)) {
dbg ("free busy dev, %s devnum %d (bug!)",
dev_dbg (*hcd->controller, "free busy dev, %s devnum %d (bug!)\n",
hcd->self.bus_name, udev->devnum);
return -EINVAL;
}
......@@ -1366,7 +1366,7 @@ void usb_hc_died (struct usb_hcd *hcd)
dev = list_entry (devlist, struct hcd_dev, dev_list);
list_for_each (urblist, &dev->urb_list) {
urb = list_entry (urblist, struct urb, urb_list);
dbg ("shutdown %s urb %p pipe %x, current status %d",
dev_dbg (*hcd->controller, "shutdown %s urb %p pipe %x, current status %d\n",
hcd->self.bus_name, urb, urb->pipe, urb->status);
if (urb->status == -EINPROGRESS)
urb->status = -ESHUTDOWN;
......
......@@ -263,7 +263,8 @@ static void usb_hub_power_on(struct usb_hub *hub)
int i;
/* Enable power to the ports */
dbg("enabling power on all ports");
dev_dbg(*hubdev(interface_to_usbdev(hub->intf)),
"enabling power on all ports\n");
dev = interface_to_usbdev(hub->intf);
for (i = 0; i < hub->descriptor->bNbrPorts; i++)
usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
......@@ -276,6 +277,7 @@ static int usb_hub_configure(struct usb_hub *hub,
struct usb_endpoint_descriptor *endpoint)
{
struct usb_device *dev = interface_to_usbdev (hub->intf);
struct device *hub_dev;
struct usb_hub_status hubstatus;
unsigned int pipe;
int maxp, ret;
......@@ -303,8 +305,9 @@ static int usb_hub_configure(struct usb_hub *hub,
goto fail;
}
hub_dev = hubdev(dev);
dev->maxchild = hub->descriptor->bNbrPorts;
dev_info (*hubdev (dev), "%d port%s detected\n", dev->maxchild,
dev_info (*hub_dev, "%d port%s detected\n", dev->maxchild,
(dev->maxchild == 1) ? "" : "s");
le16_to_cpus(&hub->descriptor->wHubCharacteristics);
......@@ -318,33 +321,33 @@ static int usb_hub_configure(struct usb_hub *hub,
[((i + 1) / 8)] & (1 << ((i + 1) % 8))
? 'F' : 'R';
portstr[dev->maxchild] = 0;
dbg("compound device; port removable status: %s", portstr);
dev_dbg(*hub_dev, "compound device; port removable status: %s\n", portstr);
} else
dbg("standalone hub");
dev_dbg(*hub_dev, "standalone hub\n");
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) {
case 0x00:
dbg("ganged power switching");
dev_dbg(*hub_dev, "ganged power switching\n");
break;
case 0x01:
dbg("individual port power switching");
dev_dbg(*hub_dev, "individual port power switching\n");
break;
case 0x02:
case 0x03:
dbg("unknown reserved power switching mode");
dev_dbg(*hub_dev, "unknown reserved power switching mode\n");
break;
}
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) {
case 0x00:
dbg("global over-current protection");
dev_dbg(*hub_dev, "global over-current protection\n");
break;
case 0x08:
dbg("individual port over-current protection");
dev_dbg(*hub_dev, "individual port over-current protection\n");
break;
case 0x10:
case 0x18:
dbg("no over-current protection");
dev_dbg(*hub_dev, "no over-current protection\n");
break;
}
......@@ -355,16 +358,16 @@ static int usb_hub_configure(struct usb_hub *hub,
case 0:
break;
case 1:
dbg("Single TT");
dev_dbg(*hub_dev, "Single TT\n");
hub->tt.hub = dev;
break;
case 2:
dbg("TT per port");
dev_dbg(*hub_dev, "TT per port\n");
hub->tt.hub = dev;
hub->tt.multi = 1;
break;
default:
dbg("Unrecognized hub protocol %d",
dev_dbg(*hub_dev, "Unrecognized hub protocol %d\n",
dev->descriptor.bDeviceProtocol);
break;
}
......@@ -372,26 +375,26 @@ static int usb_hub_configure(struct usb_hub *hub,
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) {
case 0x00:
if (dev->descriptor.bDeviceProtocol != 0)
dbg("TT requires at most 8 FS bit times");
dev_dbg(*hub_dev, "TT requires at most 8 FS bit times\n");
break;
case 0x20:
dbg("TT requires at most 16 FS bit times");
dev_dbg(*hub_dev, "TT requires at most 16 FS bit times\n");
break;
case 0x40:
dbg("TT requires at most 24 FS bit times");
dev_dbg(*hub_dev, "TT requires at most 24 FS bit times\n");
break;
case 0x60:
dbg("TT requires at most 32 FS bit times");
dev_dbg(*hub_dev, "TT requires at most 32 FS bit times\n");
break;
}
dbg("Port indicators are %s supported",
dev_dbg(*hub_dev, "Port indicators are %s supported\n",
(hub->descriptor->wHubCharacteristics & HUB_CHAR_PORTIND)
? "" : "not");
dbg("power on to power good time: %dms",
dev_dbg(*hub_dev, "power on to power good time: %dms\n",
hub->descriptor->bPwrOn2PwrGood * 2);
dbg("hub controller current requirement: %dmA",
dev_dbg(*hub_dev, "hub controller current requirement: %dmA\n",
hub->descriptor->bHubContrCurrent);
ret = usb_get_hub_status(dev, &hubstatus);
......@@ -402,11 +405,11 @@ static int usb_hub_configure(struct usb_hub *hub,
le16_to_cpus(&hubstatus.wHubStatus);
dbg("local power source is %s",
dev_dbg(*hub_dev, "local power source is %s\n",
(hubstatus.wHubStatus & HUB_STATUS_LOCAL_POWER)
? "lost (inactive)" : "good");
dbg("%sover-current condition exists",
dev_dbg(*hub_dev, "%sover-current condition exists\n",
(hubstatus.wHubStatus & HUB_STATUS_OVERCURRENT) ? "" : "no ");
/* Start the interrupt endpoint */
......
......@@ -84,19 +84,19 @@ int usb_device_probe(struct device *dev)
const struct usb_device_id *id;
int error = -ENODEV;
dbg("%s", __FUNCTION__);
dev_dbg(*dev, "%s\n", __FUNCTION__);
if (!driver->probe)
return error;
if (!try_module_get(driver->owner)) {
err ("Can't get a module reference for %s", driver->name);
dev_err (*dev, "Can't get a module reference for %s\n", driver->name);
return error;
}
id = usb_match_id (intf, driver->id_table);
if (id) {
dbg ("%s - got id", __FUNCTION__);
dev_dbg (*dev, "%s - got id\n", __FUNCTION__);
down (&driver->serialize);
error = driver->probe (intf, id);
up (&driver->serialize);
......@@ -118,7 +118,7 @@ int usb_device_remove(struct device *dev)
driver = to_usb_driver(dev->driver);
if (!driver) {
err("%s does not have a valid driver to work with!",
dev_err(*dev, "%s does not have a valid driver to work with!",
__FUNCTION__);
return -ENODEV;
}
......@@ -126,7 +126,7 @@ int usb_device_remove(struct device *dev)
if (!try_module_get(driver->owner)) {
// FIXME this happens even when we just rmmod
// drivers that aren't in active use...
err("Dieing driver still bound to device.\n");
dev_err(*dev, "Dieing driver still bound to device.\n");
return -EIO;
}
......@@ -1042,7 +1042,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
wait_ms(200);
}
if (err < 0) {
err("USB device not accepting new address=%d (error=%d)",
dev_err(dev->dev, "USB device not accepting new address=%d (error=%d)\n",
dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
......@@ -1060,9 +1060,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
if (err < 8) {
if (err < 0)
err("USB device not responding, giving up (error=%d)", err);
dev_err(dev->dev, "USB device not responding, giving up (error=%d)\n", err);
else
err("USB device descriptor short read (expected %i, got %i)", 8, err);
dev_err(dev->dev, "USB device descriptor short read (expected %i, got %i)\n", 8, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
return 1;
......@@ -1077,9 +1077,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_device_descriptor(dev);
if (err < (signed)sizeof(dev->descriptor)) {
if (err < 0)
err("unable to get device descriptor (error=%d)", err);
dev_err(dev->dev, "unable to get device descriptor (error=%d)\n", err);
else
err("USB device descriptor short read (expected %Zi, got %i)",
dev_err(dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n",
sizeof(dev->descriptor), err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
......@@ -1089,7 +1089,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_configuration(dev);
if (err < 0) {
err("unable to get device %d configuration (error=%d)",
dev_err(dev->dev, "unable to get device %d configuration (error=%d)\n",
dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
......@@ -1099,7 +1099,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* we set the default configuration here */
err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
if (err) {
err("failed to set device %d default configuration (error=%d)",
dev_err(dev->dev, "failed to set device %d default configuration (error=%d)\n",
dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
......@@ -1151,7 +1151,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev->bus->bus_name, dev->devpath,
desc->bInterfaceNumber);
}
dbg ("%s - registering %s", __FUNCTION__, interface->dev.bus_id);
dev_dbg (dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id);
device_add (&interface->dev);
usb_create_driverfs_intf_files (interface);
}
......
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