Commit 7309225c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: drivers/usb/core/ fixups due to dev_printk change

parent 27cb1287
...@@ -147,7 +147,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -147,7 +147,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
goto clean_2; goto clean_2;
} }
dev_info (*hcd->controller, "%s\n", hcd->product_desc); dev_info (hcd->controller, "%s\n", hcd->product_desc);
#ifndef __sparc__ #ifndef __sparc__
sprintf (buf, "%d", dev->irq); sprintf (buf, "%d", dev->irq);
...@@ -156,7 +156,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -156,7 +156,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
#endif #endif
if (request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ, hcd->description, hcd) if (request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ, hcd->description, hcd)
!= 0) { != 0) {
dev_err (*hcd->controller, dev_err (hcd->controller,
"request interrupt %s failed\n", bufp); "request interrupt %s failed\n", bufp);
retval = -EBUSY; retval = -EBUSY;
goto clean_3; goto clean_3;
...@@ -165,7 +165,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -165,7 +165,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
hcd->regs = base; hcd->regs = base;
hcd->region = region; hcd->region = region;
dev_info (*hcd->controller, "irq %s, %s %p\n", bufp, dev_info (hcd->controller, "irq %s, %s %p\n", bufp,
(driver->flags & HCD_MEMORY) ? "pci mem" : "io base", (driver->flags & HCD_MEMORY) ? "pci mem" : "io base",
base); base);
...@@ -207,7 +207,7 @@ void usb_hcd_pci_remove (struct pci_dev *dev) ...@@ -207,7 +207,7 @@ void usb_hcd_pci_remove (struct pci_dev *dev)
hcd = pci_get_drvdata(dev); hcd = pci_get_drvdata(dev);
if (!hcd) if (!hcd)
return; return;
dev_info (*hcd->controller, "remove, state %x\n", hcd->state); dev_info (hcd->controller, "remove, state %x\n", hcd->state);
if (in_interrupt ()) BUG (); if (in_interrupt ()) BUG ();
...@@ -234,7 +234,7 @@ void usb_hcd_pci_remove (struct pci_dev *dev) ...@@ -234,7 +234,7 @@ void usb_hcd_pci_remove (struct pci_dev *dev)
usb_deregister_bus (&hcd->self); usb_deregister_bus (&hcd->self);
if (atomic_read (&hcd->self.refcnt) != 1) { if (atomic_read (&hcd->self.refcnt) != 1) {
dev_warn (*hcd->controller, dev_warn (hcd->controller,
"dangling refs (%d) to bus %d!\n", "dangling refs (%d) to bus %d!\n",
atomic_read (&hcd->self.refcnt) - 1, atomic_read (&hcd->self.refcnt) - 1,
hcd->self.busnum); hcd->self.busnum);
...@@ -285,7 +285,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state) ...@@ -285,7 +285,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
int retval; int retval;
hcd = pci_get_drvdata(dev); hcd = pci_get_drvdata(dev);
dev_info (*hcd->controller, "suspend to state %d\n", state); dev_info (hcd->controller, "suspend to state %d\n", state);
pci_save_state (dev, hcd->pci_state); pci_save_state (dev, hcd->pci_state);
...@@ -314,12 +314,12 @@ int usb_hcd_pci_resume (struct pci_dev *dev) ...@@ -314,12 +314,12 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
int retval; int retval;
hcd = pci_get_drvdata(dev); hcd = pci_get_drvdata(dev);
dev_info (*hcd->controller, "resume\n"); dev_info (hcd->controller, "resume\n");
/* guard against multiple resumes (APM bug?) */ /* guard against multiple resumes (APM bug?) */
atomic_inc (&hcd->resume_count); atomic_inc (&hcd->resume_count);
if (atomic_read (&hcd->resume_count) != 1) { if (atomic_read (&hcd->resume_count) != 1) {
dev_err (*hcd->controller, "concurrent PCI resumes\n"); dev_err (hcd->controller, "concurrent PCI resumes\n");
retval = 0; retval = 0;
goto done; goto done;
} }
......
...@@ -347,7 +347,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -347,7 +347,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */ /* FALLTHROUGH */
case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
case DeviceOutRequest | USB_REQ_SET_FEATURE: case DeviceOutRequest | USB_REQ_SET_FEATURE:
dev_dbg (*hcd->controller, "no device features yet yet\n"); dev_dbg (hcd->controller, "no device features yet yet\n");
break; break;
case DeviceRequest | USB_REQ_GET_CONFIGURATION: case DeviceRequest | USB_REQ_GET_CONFIGURATION:
ubuf [0] = 1; ubuf [0] = 1;
...@@ -390,7 +390,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -390,7 +390,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
break; break;
case DeviceOutRequest | USB_REQ_SET_ADDRESS: case DeviceOutRequest | USB_REQ_SET_ADDRESS:
// wValue == urb->dev->devaddr // wValue == urb->dev->devaddr
dev_dbg (*hcd->controller, "root hub device address %d\n", dev_dbg (hcd->controller, "root hub device address %d\n",
wValue); wValue);
break; break;
...@@ -405,7 +405,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -405,7 +405,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */ /* FALLTHROUGH */
case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_CLEAR_FEATURE:
case EndpointOutRequest | USB_REQ_SET_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE:
dev_dbg (*hcd->controller, "no endpoint features yet\n"); dev_dbg (hcd->controller, "no endpoint features yet\n");
break; break;
/* CLASS REQUESTS (and errors) */ /* CLASS REQUESTS (and errors) */
...@@ -419,12 +419,12 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) ...@@ -419,12 +419,12 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
error: error:
/* "protocol stall" on error */ /* "protocol stall" on error */
urb->status = -EPIPE; urb->status = -EPIPE;
dev_dbg (*hcd->controller, "unsupported hub control message (maxchild %d)\n", dev_dbg (hcd->controller, "unsupported hub control message (maxchild %d)\n",
urb->dev->maxchild); urb->dev->maxchild);
} }
if (urb->status) { if (urb->status) {
urb->actual_length = 0; urb->actual_length = 0;
dev_dbg (*hcd->controller, "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n", dev_dbg (hcd->controller, "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n",
typeReq, wValue, wIndex, wLength, urb->status); typeReq, wValue, wIndex, wLength, urb->status);
} }
if (bufp) { if (bufp) {
...@@ -457,7 +457,7 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb) ...@@ -457,7 +457,7 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb)
if (timer_pending (&hcd->rh_timer) if (timer_pending (&hcd->rh_timer)
|| urb->status != -EINPROGRESS || urb->status != -EINPROGRESS
|| urb->transfer_buffer_length < len) { || urb->transfer_buffer_length < len) {
dev_dbg (*hcd->controller, "not queuing status urb, stat %d\n", urb->status); dev_dbg (hcd->controller, "not queuing status urb, stat %d\n", urb->status);
return -EINVAL; return -EINVAL;
} }
...@@ -668,7 +668,7 @@ void usb_register_bus(struct usb_bus *bus) ...@@ -668,7 +668,7 @@ void usb_register_bus(struct usb_bus *bus)
usbfs_add_bus (bus); usbfs_add_bus (bus);
dev_info (*bus->controller, "new USB bus registered, assigned bus number %d\n", bus->busnum); dev_info (bus->controller, "new USB bus registered, assigned bus number %d\n", bus->busnum);
} }
EXPORT_SYMBOL (usb_register_bus); EXPORT_SYMBOL (usb_register_bus);
...@@ -682,7 +682,7 @@ EXPORT_SYMBOL (usb_register_bus); ...@@ -682,7 +682,7 @@ EXPORT_SYMBOL (usb_register_bus);
*/ */
void usb_deregister_bus (struct usb_bus *bus) void usb_deregister_bus (struct usb_bus *bus)
{ {
dev_info (*bus->controller, "USB bus %d deregistered\n", bus->busnum); dev_info (bus->controller, "USB bus %d deregistered\n", bus->busnum);
/* /*
* NOTE: make sure that all the devices are removed by the * NOTE: make sure that all the devices are removed by the
...@@ -718,7 +718,7 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev ...@@ -718,7 +718,7 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev
sprintf (&usb_dev->dev.bus_id[0], "usb%d", usb_dev->bus->busnum); sprintf (&usb_dev->dev.bus_id[0], "usb%d", usb_dev->bus->busnum);
retval = usb_new_device (usb_dev, parent_dev); retval = usb_new_device (usb_dev, parent_dev);
if (retval) if (retval)
dev_err (*parent_dev, "can't register root hub for %s, %d\n", dev_err (parent_dev, "can't register root hub for %s, %d\n",
usb_dev->dev.bus_id, retval); usb_dev->dev.bus_id, retval);
return retval; return retval;
} }
...@@ -825,7 +825,7 @@ int usb_check_bandwidth (struct usb_device *dev, struct urb *urb) ...@@ -825,7 +825,7 @@ int usb_check_bandwidth (struct usb_device *dev, struct urb *urb)
#else #else
"would have "; "would have ";
#endif #endif
dev_dbg (dev->dev, "usb_check_bandwidth %sFAILED: %d + %ld = %d usec\n", dev_dbg (&dev->dev, "usb_check_bandwidth %sFAILED: %d + %ld = %d usec\n",
mode, old_alloc, bustime, new_alloc); mode, old_alloc, bustime, new_alloc);
#endif #endif
#ifdef CONFIG_USB_BANDWIDTH #ifdef CONFIG_USB_BANDWIDTH
...@@ -864,7 +864,7 @@ void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, int bustime, ...@@ -864,7 +864,7 @@ void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, int bustime,
urb->bandwidth = bustime; urb->bandwidth = bustime;
#ifdef USB_BANDWIDTH_MESSAGES #ifdef USB_BANDWIDTH_MESSAGES
dev_dbg (dev->dev, "bandwidth alloc increased by %d (%s) to %d for %d requesters\n", dev_dbg (&dev->dev, "bandwidth alloc increased by %d (%s) to %d for %d requesters\n",
bustime, bustime,
isoc ? "ISOC" : "INTR", isoc ? "ISOC" : "INTR",
dev->bus->bandwidth_allocated, dev->bus->bandwidth_allocated,
...@@ -893,7 +893,7 @@ void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, int isoc) ...@@ -893,7 +893,7 @@ void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, int isoc)
dev->bus->bandwidth_int_reqs--; dev->bus->bandwidth_int_reqs--;
#ifdef USB_BANDWIDTH_MESSAGES #ifdef USB_BANDWIDTH_MESSAGES
dev_dbg (dev->dev, "bandwidth alloc reduced by %d (%s) to %d for %d requesters\n", dev_dbg (&dev->dev, "bandwidth alloc reduced by %d (%s) to %d for %d requesters\n",
urb->bandwidth, urb->bandwidth,
isoc ? "ISOC" : "INTR", isoc ? "ISOC" : "INTR",
dev->bus->bandwidth_allocated, dev->bus->bandwidth_allocated,
...@@ -1154,7 +1154,7 @@ static int hcd_unlink_urb (struct urb *urb) ...@@ -1154,7 +1154,7 @@ static int hcd_unlink_urb (struct urb *urb)
*/ */
if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) { if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
if (in_interrupt ()) { if (in_interrupt ()) {
dev_dbg (*hcd->controller, "non-async unlink in_interrupt"); dev_dbg (hcd->controller, "non-async unlink in_interrupt");
retval = -EWOULDBLOCK; retval = -EWOULDBLOCK;
goto done; goto done;
} }
...@@ -1180,7 +1180,7 @@ static int hcd_unlink_urb (struct urb *urb) ...@@ -1180,7 +1180,7 @@ static int hcd_unlink_urb (struct urb *urb)
/* hcds shouldn't really fail these calls, but... */ /* hcds shouldn't really fail these calls, but... */
if (retval) { if (retval) {
dev_dbg (*sys, "dequeue %p --> %d\n", urb, retval); dev_dbg (sys, "dequeue %p --> %d\n", urb, retval);
if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) { if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
spin_lock_irqsave (&urb->lock, flags); spin_lock_irqsave (&urb->lock, flags);
urb->complete = splice.complete; urb->complete = splice.complete;
...@@ -1203,7 +1203,7 @@ static int hcd_unlink_urb (struct urb *urb) ...@@ -1203,7 +1203,7 @@ static int hcd_unlink_urb (struct urb *urb)
spin_unlock_irqrestore (&urb->lock, flags); spin_unlock_irqrestore (&urb->lock, flags);
bye: bye:
if (retval && sys) if (retval && sys)
dev_dbg (*sys, "hcd_unlink_urb %p fail %d\n", urb, retval); dev_dbg (sys, "hcd_unlink_urb %p fail %d\n", urb, retval);
return retval; return retval;
} }
...@@ -1234,7 +1234,7 @@ static int hcd_free_dev (struct usb_device *udev) ...@@ -1234,7 +1234,7 @@ static int hcd_free_dev (struct usb_device *udev)
/* device driver problem with refcounts? */ /* device driver problem with refcounts? */
if (!list_empty (&dev->urb_list)) { if (!list_empty (&dev->urb_list)) {
dev_dbg (*hcd->controller, "free busy dev, %s devnum %d (bug!)\n", dev_dbg (hcd->controller, "free busy dev, %s devnum %d (bug!)\n",
hcd->self.bus_name, udev->devnum); hcd->self.bus_name, udev->devnum);
return -EINVAL; return -EINVAL;
} }
...@@ -1367,7 +1367,7 @@ void usb_hc_died (struct usb_hcd *hcd) ...@@ -1367,7 +1367,7 @@ void usb_hc_died (struct usb_hcd *hcd)
dev = list_entry (devlist, struct hcd_dev, dev_list); dev = list_entry (devlist, struct hcd_dev, dev_list);
list_for_each (urblist, &dev->urb_list) { list_for_each (urblist, &dev->urb_list) {
urb = list_entry (urblist, struct urb, urb_list); urb = list_entry (urblist, struct urb, urb_list);
dev_dbg (*hcd->controller, "shutdown %s urb %p pipe %x, current status %d\n", dev_dbg (hcd->controller, "shutdown %s urb %p pipe %x, current status %d\n",
hcd->self.bus_name, urb, urb->pipe, urb->status); hcd->self.bus_name, urb, urb->pipe, urb->status);
if (urb->status == -EINPROGRESS) if (urb->status == -EINPROGRESS)
urb->status = -ESHUTDOWN; urb->status = -ESHUTDOWN;
......
...@@ -263,7 +263,7 @@ static void usb_hub_power_on(struct usb_hub *hub) ...@@ -263,7 +263,7 @@ static void usb_hub_power_on(struct usb_hub *hub)
int i; int i;
/* Enable power to the ports */ /* Enable power to the ports */
dev_dbg(*hubdev(interface_to_usbdev(hub->intf)), dev_dbg(hubdev(interface_to_usbdev(hub->intf)),
"enabling power on all ports\n"); "enabling power on all ports\n");
dev = interface_to_usbdev(hub->intf); dev = interface_to_usbdev(hub->intf);
for (i = 0; i < hub->descriptor->bNbrPorts; i++) for (i = 0; i < hub->descriptor->bNbrPorts; i++)
...@@ -307,7 +307,7 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -307,7 +307,7 @@ static int usb_hub_configure(struct usb_hub *hub,
hub_dev = hubdev(dev); hub_dev = hubdev(dev);
dev->maxchild = hub->descriptor->bNbrPorts; dev->maxchild = hub->descriptor->bNbrPorts;
dev_info (*hub_dev, "%d port%s detected\n", dev->maxchild, dev_info (hub_dev, "%d port%s detected\n", dev->maxchild,
(dev->maxchild == 1) ? "" : "s"); (dev->maxchild == 1) ? "" : "s");
le16_to_cpus(&hub->descriptor->wHubCharacteristics); le16_to_cpus(&hub->descriptor->wHubCharacteristics);
...@@ -321,33 +321,33 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -321,33 +321,33 @@ static int usb_hub_configure(struct usb_hub *hub,
[((i + 1) / 8)] & (1 << ((i + 1) % 8)) [((i + 1) / 8)] & (1 << ((i + 1) % 8))
? 'F' : 'R'; ? 'F' : 'R';
portstr[dev->maxchild] = 0; portstr[dev->maxchild] = 0;
dev_dbg(*hub_dev, "compound device; port removable status: %s\n", portstr); dev_dbg(hub_dev, "compound device; port removable status: %s\n", portstr);
} else } else
dev_dbg(*hub_dev, "standalone hub\n"); dev_dbg(hub_dev, "standalone hub\n");
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) { switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) {
case 0x00: case 0x00:
dev_dbg(*hub_dev, "ganged power switching\n"); dev_dbg(hub_dev, "ganged power switching\n");
break; break;
case 0x01: case 0x01:
dev_dbg(*hub_dev, "individual port power switching\n"); dev_dbg(hub_dev, "individual port power switching\n");
break; break;
case 0x02: case 0x02:
case 0x03: case 0x03:
dev_dbg(*hub_dev, "unknown reserved power switching mode\n"); dev_dbg(hub_dev, "unknown reserved power switching mode\n");
break; break;
} }
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) { switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) {
case 0x00: case 0x00:
dev_dbg(*hub_dev, "global over-current protection\n"); dev_dbg(hub_dev, "global over-current protection\n");
break; break;
case 0x08: case 0x08:
dev_dbg(*hub_dev, "individual port over-current protection\n"); dev_dbg(hub_dev, "individual port over-current protection\n");
break; break;
case 0x10: case 0x10:
case 0x18: case 0x18:
dev_dbg(*hub_dev, "no over-current protection\n"); dev_dbg(hub_dev, "no over-current protection\n");
break; break;
} }
...@@ -358,16 +358,16 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -358,16 +358,16 @@ static int usb_hub_configure(struct usb_hub *hub,
case 0: case 0:
break; break;
case 1: case 1:
dev_dbg(*hub_dev, "Single TT\n"); dev_dbg(hub_dev, "Single TT\n");
hub->tt.hub = dev; hub->tt.hub = dev;
break; break;
case 2: case 2:
dev_dbg(*hub_dev, "TT per port\n"); dev_dbg(hub_dev, "TT per port\n");
hub->tt.hub = dev; hub->tt.hub = dev;
hub->tt.multi = 1; hub->tt.multi = 1;
break; break;
default: default:
dev_dbg(*hub_dev, "Unrecognized hub protocol %d\n", dev_dbg(hub_dev, "Unrecognized hub protocol %d\n",
dev->descriptor.bDeviceProtocol); dev->descriptor.bDeviceProtocol);
break; break;
} }
...@@ -375,26 +375,26 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -375,26 +375,26 @@ static int usb_hub_configure(struct usb_hub *hub,
switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) { switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) {
case 0x00: case 0x00:
if (dev->descriptor.bDeviceProtocol != 0) if (dev->descriptor.bDeviceProtocol != 0)
dev_dbg(*hub_dev, "TT requires at most 8 FS bit times\n"); dev_dbg(hub_dev, "TT requires at most 8 FS bit times\n");
break; break;
case 0x20: case 0x20:
dev_dbg(*hub_dev, "TT requires at most 16 FS bit times\n"); dev_dbg(hub_dev, "TT requires at most 16 FS bit times\n");
break; break;
case 0x40: case 0x40:
dev_dbg(*hub_dev, "TT requires at most 24 FS bit times\n"); dev_dbg(hub_dev, "TT requires at most 24 FS bit times\n");
break; break;
case 0x60: case 0x60:
dev_dbg(*hub_dev, "TT requires at most 32 FS bit times\n"); dev_dbg(hub_dev, "TT requires at most 32 FS bit times\n");
break; break;
} }
dev_dbg(*hub_dev, "Port indicators are %s supported\n", dev_dbg(hub_dev, "Port indicators are %s supported\n",
(hub->descriptor->wHubCharacteristics & HUB_CHAR_PORTIND) (hub->descriptor->wHubCharacteristics & HUB_CHAR_PORTIND)
? "" : "not"); ? "" : "not");
dev_dbg(*hub_dev, "power on to power good time: %dms\n", dev_dbg(hub_dev, "power on to power good time: %dms\n",
hub->descriptor->bPwrOn2PwrGood * 2); hub->descriptor->bPwrOn2PwrGood * 2);
dev_dbg(*hub_dev, "hub controller current requirement: %dmA\n", dev_dbg(hub_dev, "hub controller current requirement: %dmA\n",
hub->descriptor->bHubContrCurrent); hub->descriptor->bHubContrCurrent);
ret = usb_get_hub_status(dev, &hubstatus); ret = usb_get_hub_status(dev, &hubstatus);
...@@ -405,11 +405,11 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -405,11 +405,11 @@ static int usb_hub_configure(struct usb_hub *hub,
le16_to_cpus(&hubstatus.wHubStatus); le16_to_cpus(&hubstatus.wHubStatus);
dev_dbg(*hub_dev, "local power source is %s\n", dev_dbg(hub_dev, "local power source is %s\n",
(hubstatus.wHubStatus & HUB_STATUS_LOCAL_POWER) (hubstatus.wHubStatus & HUB_STATUS_LOCAL_POWER)
? "lost (inactive)" : "good"); ? "lost (inactive)" : "good");
dev_dbg(*hub_dev, "%sover-current condition exists\n", dev_dbg(hub_dev, "%sover-current condition exists\n",
(hubstatus.wHubStatus & HUB_STATUS_OVERCURRENT) ? "" : "no "); (hubstatus.wHubStatus & HUB_STATUS_OVERCURRENT) ? "" : "no ");
/* Start the interrupt endpoint */ /* Start the interrupt endpoint */
...@@ -442,7 +442,7 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -442,7 +442,7 @@ static int usb_hub_configure(struct usb_hub *hub,
return 0; return 0;
fail: fail:
dev_err (hub->intf->dev, "config failed, %s (err %d)\n", dev_err (&hub->intf->dev, "config failed, %s (err %d)\n",
message, ret); message, ret);
/* hub_disconnect() frees urb and descriptor */ /* hub_disconnect() frees urb and descriptor */
return ret; return ret;
...@@ -505,7 +505,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -505,7 +505,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
if ((desc->desc.bInterfaceSubClass != 0) && if ((desc->desc.bInterfaceSubClass != 0) &&
(desc->desc.bInterfaceSubClass != 1)) { (desc->desc.bInterfaceSubClass != 1)) {
descriptor_error: descriptor_error:
dev_err (intf->dev, "bad descriptor, ignoring hub\n"); dev_err (&intf->dev, "bad descriptor, ignoring hub\n");
return -EIO; return -EIO;
} }
...@@ -529,7 +529,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -529,7 +529,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
} }
/* We found a hub */ /* We found a hub */
dev_info (*hubdev (dev), "USB hub found\n"); dev_info (hubdev (dev), "USB hub found\n");
hub = kmalloc(sizeof(*hub), GFP_KERNEL); hub = kmalloc(sizeof(*hub), GFP_KERNEL);
if (!hub) { if (!hub) {
...@@ -714,7 +714,7 @@ static int usb_hub_port_wait_reset(struct usb_device *hub, int port, ...@@ -714,7 +714,7 @@ static int usb_hub_port_wait_reset(struct usb_device *hub, int port,
if (delay_time >= 2 * HUB_SHORT_RESET_TIME) if (delay_time >= 2 * HUB_SHORT_RESET_TIME)
delay = HUB_LONG_RESET_TIME; delay = HUB_LONG_RESET_TIME;
dev_dbg (*hubdev (hub), dev_dbg (hubdev (hub),
"port %d not reset yet, waiting %dms\n", "port %d not reset yet, waiting %dms\n",
port + 1, delay); port + 1, delay);
} }
...@@ -740,13 +740,13 @@ static int usb_hub_port_reset(struct usb_device *hub, int port, ...@@ -740,13 +740,13 @@ static int usb_hub_port_reset(struct usb_device *hub, int port,
return status; return status;
} }
dev_dbg (*hubdev (hub), dev_dbg (hubdev (hub),
"port %d not enabled, trying reset again...\n", "port %d not enabled, trying reset again...\n",
port + 1); port + 1);
delay = HUB_LONG_RESET_TIME; delay = HUB_LONG_RESET_TIME;
} }
dev_err (*hubdev (hub), dev_err (hubdev (hub),
"Cannot enable port %i. Maybe the USB cable is bad?\n", "Cannot enable port %i. Maybe the USB cable is bad?\n",
port + 1); port + 1);
...@@ -814,7 +814,7 @@ static int usb_hub_port_debounce(struct usb_device *hub, int port) ...@@ -814,7 +814,7 @@ static int usb_hub_port_debounce(struct usb_device *hub, int port)
} }
/* XXX Replace this with dbg() when 2.6 is about to ship. */ /* XXX Replace this with dbg() when 2.6 is about to ship. */
dev_info (*hubdev (hub), dev_info (hubdev (hub),
"debounce: port %d: delay %dms stable %d status 0x%x\n", "debounce: port %d: delay %dms stable %d status 0x%x\n",
port + 1, delay_time, stable_count, portstatus); port + 1, delay_time, stable_count, portstatus);
...@@ -829,7 +829,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port, ...@@ -829,7 +829,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
unsigned int delay = HUB_SHORT_RESET_TIME; unsigned int delay = HUB_SHORT_RESET_TIME;
int i; int i;
dev_dbg (hubstate->intf->dev, dev_dbg (&hubstate->intf->dev,
"port %d, status %x, change %x, %s\n", "port %d, status %x, change %x, %s\n",
port + 1, portstatus, portchange, portspeed (portstatus)); port + 1, portstatus, portchange, portspeed (portstatus));
...@@ -849,7 +849,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port, ...@@ -849,7 +849,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
} }
if (usb_hub_port_debounce(hub, port)) { if (usb_hub_port_debounce(hub, port)) {
dev_err (hubstate->intf->dev, dev_err (&hubstate->intf->dev,
"connect-debounce failed, port %d disabled\n", "connect-debounce failed, port %d disabled\n",
port+1); port+1);
usb_hub_port_disable(hub, port); usb_hub_port_disable(hub, port);
...@@ -870,7 +870,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port, ...@@ -870,7 +870,7 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
/* Allocate a new device struct */ /* Allocate a new device struct */
dev = usb_alloc_dev(hub, hub->bus); dev = usb_alloc_dev(hub, hub->bus);
if (!dev) { if (!dev) {
dev_err (hubstate->intf->dev, dev_err (&hubstate->intf->dev,
"couldn't allocate usb_device\n"); "couldn't allocate usb_device\n");
break; break;
} }
...@@ -914,10 +914,10 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port, ...@@ -914,10 +914,10 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
len = snprintf (dev->devpath, sizeof dev->devpath, len = snprintf (dev->devpath, sizeof dev->devpath,
"%d", port + 1); "%d", port + 1);
if (len == sizeof dev->devpath) if (len == sizeof dev->devpath)
dev_err (hubstate->intf->dev, dev_err (&hubstate->intf->dev,
"devpath size! usb/%03d/%03d path %s\n", "devpath size! usb/%03d/%03d path %s\n",
dev->bus->busnum, dev->devnum, dev->devpath); dev->bus->busnum, dev->devnum, dev->devpath);
dev_info (hubstate->intf->dev, dev_info (&hubstate->intf->dev,
"new USB device on port %d, assigned address %d\n", "new USB device on port %d, assigned address %d\n",
port + 1, dev->devnum); port + 1, dev->devnum);
...@@ -1006,7 +1006,7 @@ static void usb_hub_events(void) ...@@ -1006,7 +1006,7 @@ static void usb_hub_events(void)
if (portchange & USB_PORT_STAT_C_CONNECTION) { if (portchange & USB_PORT_STAT_C_CONNECTION) {
usb_hub_port_connect_change(hub, i, portstatus, portchange); usb_hub_port_connect_change(hub, i, portstatus, portchange);
} else if (portchange & USB_PORT_STAT_C_ENABLE) { } else if (portchange & USB_PORT_STAT_C_ENABLE) {
dev_dbg (*hubdev (dev), dev_dbg (hubdev (dev),
"port %d enable change, status %x\n", "port %d enable change, status %x\n",
i + 1, portstatus); i + 1, portstatus);
usb_clear_port_feature(dev, usb_clear_port_feature(dev,
......
...@@ -177,7 +177,7 @@ void usb_show_string(struct usb_device *dev, char *id, int index) ...@@ -177,7 +177,7 @@ void usb_show_string(struct usb_device *dev, char *id, int index)
if (!(buf = kmalloc(256, GFP_KERNEL))) if (!(buf = kmalloc(256, GFP_KERNEL)))
return; return;
if (usb_string(dev, index, buf, 256) > 0) if (usb_string(dev, index, buf, 256) > 0)
dev_printk(KERN_INFO, dev->dev, "%s: %s\n", id, buf); dev_printk(KERN_INFO, &dev->dev, "%s: %s\n", id, buf);
kfree(buf); kfree(buf);
} }
......
...@@ -84,19 +84,19 @@ int usb_device_probe(struct device *dev) ...@@ -84,19 +84,19 @@ int usb_device_probe(struct device *dev)
const struct usb_device_id *id; const struct usb_device_id *id;
int error = -ENODEV; int error = -ENODEV;
dev_dbg(*dev, "%s\n", __FUNCTION__); dev_dbg(dev, "%s\n", __FUNCTION__);
if (!driver->probe) if (!driver->probe)
return error; return error;
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->owner)) {
dev_err (*dev, "Can't get a module reference for %s\n", driver->name); dev_err (dev, "Can't get a module reference for %s\n", driver->name);
return error; return error;
} }
id = usb_match_id (intf, driver->id_table); id = usb_match_id (intf, driver->id_table);
if (id) { if (id) {
dev_dbg (*dev, "%s - got id\n", __FUNCTION__); dev_dbg (dev, "%s - got id\n", __FUNCTION__);
down (&driver->serialize); down (&driver->serialize);
error = driver->probe (intf, id); error = driver->probe (intf, id);
up (&driver->serialize); up (&driver->serialize);
...@@ -118,7 +118,7 @@ int usb_device_remove(struct device *dev) ...@@ -118,7 +118,7 @@ int usb_device_remove(struct device *dev)
driver = to_usb_driver(dev->driver); driver = to_usb_driver(dev->driver);
if (!driver) { if (!driver) {
dev_err(*dev, "%s does not have a valid driver to work with!", dev_err(dev, "%s does not have a valid driver to work with!",
__FUNCTION__); __FUNCTION__);
return -ENODEV; return -ENODEV;
} }
...@@ -126,7 +126,7 @@ int usb_device_remove(struct device *dev) ...@@ -126,7 +126,7 @@ int usb_device_remove(struct device *dev)
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->owner)) {
// FIXME this happens even when we just rmmod // FIXME this happens even when we just rmmod
// drivers that aren't in active use... // drivers that aren't in active use...
dev_err(*dev, "Dieing driver still bound to device.\n"); dev_err(dev, "Dieing driver still bound to device.\n");
return -EIO; return -EIO;
} }
...@@ -827,7 +827,7 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -827,7 +827,7 @@ void usb_disconnect(struct usb_device **pdev)
*pdev = NULL; *pdev = NULL;
dev_info (dev->dev, "USB disconnect, address %d\n", dev->devnum); dev_info (&dev->dev, "USB disconnect, address %d\n", dev->devnum);
/* Free up all the children before we remove this device */ /* Free up all the children before we remove this device */
for (i = 0; i < USB_MAXCHILDREN; i++) { for (i = 0; i < USB_MAXCHILDREN; i++) {
...@@ -836,7 +836,7 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -836,7 +836,7 @@ void usb_disconnect(struct usb_device **pdev)
usb_disconnect(child); usb_disconnect(child);
} }
dev_dbg (dev->dev, "unregistering interfaces\n"); dev_dbg (&dev->dev, "unregistering interfaces\n");
if (dev->actconfig) { if (dev->actconfig) {
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *interface = &dev->actconfig->interface[i]; struct usb_interface *interface = &dev->actconfig->interface[i];
...@@ -846,7 +846,7 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -846,7 +846,7 @@ void usb_disconnect(struct usb_device **pdev)
} }
} }
dev_dbg (dev->dev, "unregistering device\n"); dev_dbg (&dev->dev, "unregistering device\n");
/* Free the device number and remove the /proc/bus/usb entry */ /* Free the device number and remove the /proc/bus/usb entry */
if (dev->devnum > 0) { if (dev->devnum > 0) {
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
...@@ -931,7 +931,7 @@ static void set_device_description (struct usb_device *dev) ...@@ -931,7 +931,7 @@ static void set_device_description (struct usb_device *dev)
if (prod && usb_string (dev, prod, prod_str, 256) > 0) { if (prod && usb_string (dev, prod, prod_str, 256) > 0) {
#ifdef DEBUG #ifdef DEBUG
dev_printk (KERN_INFO, dev->dev, "Product: %s\n", prod_str); dev_printk (KERN_INFO, &dev->dev, "Product: %s\n", prod_str);
#endif #endif
} else { } else {
prod_str = 0; prod_str = 0;
...@@ -939,7 +939,7 @@ static void set_device_description (struct usb_device *dev) ...@@ -939,7 +939,7 @@ static void set_device_description (struct usb_device *dev)
if (mfgr && usb_string (dev, mfgr, mfgr_str, 256) > 0) { if (mfgr && usb_string (dev, mfgr, mfgr_str, 256) > 0) {
#ifdef DEBUG #ifdef DEBUG
dev_printk (KERN_INFO, dev->dev, "Manufacturer: %s\n", mfgr_str); dev_printk (KERN_INFO, &dev->dev, "Manufacturer: %s\n", mfgr_str);
#endif #endif
} else { } else {
mfgr_str = 0; mfgr_str = 0;
...@@ -1042,7 +1042,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1042,7 +1042,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
wait_ms(200); wait_ms(200);
} }
if (err < 0) { if (err < 0) {
dev_err(dev->dev, "USB device not accepting new address=%d (error=%d)\n", dev_err(&dev->dev, "USB device not accepting new address=%d (error=%d)\n",
dev->devnum, err); dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1; dev->devnum = -1;
...@@ -1060,9 +1060,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1060,9 +1060,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
if (err < 8) { if (err < 8) {
if (err < 0) if (err < 0)
dev_err(dev->dev, "USB device not responding, giving up (error=%d)\n", err); dev_err(&dev->dev, "USB device not responding, giving up (error=%d)\n", err);
else else
dev_err(dev->dev, "USB device descriptor short read (expected %i, got %i)\n", 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); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1; dev->devnum = -1;
return 1; return 1;
...@@ -1077,9 +1077,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1077,9 +1077,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_device_descriptor(dev); err = usb_get_device_descriptor(dev);
if (err < (signed)sizeof(dev->descriptor)) { if (err < (signed)sizeof(dev->descriptor)) {
if (err < 0) if (err < 0)
dev_err(dev->dev, "unable to get device descriptor (error=%d)\n", err); dev_err(&dev->dev, "unable to get device descriptor (error=%d)\n", err);
else else
dev_err(dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n", dev_err(&dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n",
sizeof(dev->descriptor), err); sizeof(dev->descriptor), err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
...@@ -1089,7 +1089,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1089,7 +1089,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_configuration(dev); err = usb_get_configuration(dev);
if (err < 0) { if (err < 0) {
dev_err(dev->dev, "unable to get device %d configuration (error=%d)\n", dev_err(&dev->dev, "unable to get device %d configuration (error=%d)\n",
dev->devnum, err); dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1; dev->devnum = -1;
...@@ -1099,7 +1099,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1099,7 +1099,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* we set the default configuration here */ /* we set the default configuration here */
err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue); err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
if (err) { if (err) {
dev_err(dev->dev, "failed to set device %d default configuration (error=%d)\n", dev_err(&dev->dev, "failed to set device %d default configuration (error=%d)\n",
dev->devnum, err); dev->devnum, err);
clear_bit(dev->devnum, dev->bus->devmap.devicemap); clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1; dev->devnum = -1;
...@@ -1108,7 +1108,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1108,7 +1108,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* USB device state == configured ... tell the world! */ /* USB device state == configured ... tell the world! */
dev_dbg(dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", dev_dbg(&dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber); dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
set_device_description (dev); set_device_description (dev);
...@@ -1151,7 +1151,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent) ...@@ -1151,7 +1151,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev->bus->bus_name, dev->devpath, dev->bus->bus_name, dev->devpath,
desc->bInterfaceNumber); desc->bInterfaceNumber);
} }
dev_dbg (dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id); dev_dbg (&dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id);
device_add (&interface->dev); device_add (&interface->dev);
usb_create_driverfs_intf_files (interface); 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