From 71e06db3b953b8cc57dec097bdc08b7ed4852277 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Tue, 18 Jun 2013 02:36:17 +0300 Subject: [PATCH] staging: octeon-usb: octeon-hcd: use dev_dbg Replace DEBUG macros with dev_dbg. Some less useful are completely deleted. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon-usb/octeon-hcd.c | 165 +++++++++++------------- 1 file changed, 77 insertions(+), 88 deletions(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index da222071d17e..accd0c594307 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -24,16 +24,6 @@ #include -//#define DEBUG_CALL(format, ...) printk(format, ##__VA_ARGS__) -#define DEBUG_CALL(format, ...) do {} while (0) -//#define DEBUG_SUBMIT(format, ...) printk(format, ##__VA_ARGS__) -#define DEBUG_SUBMIT(format, ...) do {} while (0) -//#define DEBUG_ROOT_HUB(format, ...) printk(format, ##__VA_ARGS__) -#define DEBUG_ROOT_HUB(format, ...) do {} while (0) -//#define DEBUG_ERROR(format, ...) printk(format, ##__VA_ARGS__) -#define DEBUG_ERROR(format, ...) do {} while (0) -#define DEBUG_FATAL(format, ...) printk(format, ##__VA_ARGS__) - struct octeon_hcd { spinlock_t lock; cvmx_usb_state_t usb; @@ -61,7 +51,7 @@ static irqreturn_t octeon_usb_irq(struct usb_hcd *hcd) { struct octeon_hcd *priv = hcd_to_octeon(hcd); unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + spin_lock_irqsave(&priv->lock, flags); cvmx_usb_poll(&priv->usb); spin_unlock_irqrestore(&priv->lock, flags); @@ -77,7 +67,7 @@ static void octeon_usb_port_callback(cvmx_usb_state_t *usb, void *user_data) { struct octeon_hcd *priv = cvmx_usb_to_octeon(usb); - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + spin_unlock(&priv->lock); usb_hcd_poll_rh_status(octeon_to_hcd(priv)); spin_lock(&priv->lock); @@ -87,7 +77,7 @@ static int octeon_usb_start(struct usb_hcd *hcd) { struct octeon_hcd *priv = hcd_to_octeon(hcd); unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + hcd->state = HC_STATE_RUNNING; spin_lock_irqsave(&priv->lock, flags); cvmx_usb_register_callback(&priv->usb, CVMX_USB_CALLBACK_PORT_CHANGED, @@ -100,7 +90,7 @@ static void octeon_usb_stop(struct usb_hcd *hcd) { struct octeon_hcd *priv = hcd_to_octeon(hcd); unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + spin_lock_irqsave(&priv->lock, flags); cvmx_usb_register_callback(&priv->usb, CVMX_USB_CALLBACK_PORT_CHANGED, NULL, NULL); @@ -111,7 +101,7 @@ static void octeon_usb_stop(struct usb_hcd *hcd) static int octeon_usb_get_frame_number(struct usb_hcd *hcd) { struct octeon_hcd *priv = hcd_to_octeon(hcd); - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + return cvmx_usb_get_frame_number(&priv->usb); } @@ -124,8 +114,10 @@ static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb, void *user_data) { struct octeon_hcd *priv = cvmx_usb_to_octeon(usb); + struct usb_hcd *hcd = octeon_to_hcd(priv); + struct device *dev = hcd->self.controller; struct urb *urb = user_data; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + urb->actual_length = bytes_transferred; urb->hcpriv = NULL; @@ -155,10 +147,10 @@ static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb, urb->iso_frame_desc[i].actual_length = iso_packet[i].length; urb->actual_length += urb->iso_frame_desc[i].actual_length; } else { - DEBUG_ERROR("%s: ISOCHRONOUS packet=%d of %d status=%d pipe=%d submit=%d size=%d\n", - __FUNCTION__, i, urb->number_of_packets, - iso_packet[i].status, pipe_handle, - submit_handle, iso_packet[i].length); + dev_dbg(dev, "ISOCHRONOUS packet=%d of %d status=%d pipe=%d submit=%d size=%d\n", + i, urb->number_of_packets, + iso_packet[i].status, pipe_handle, + submit_handle, iso_packet[i].length); urb->iso_frame_desc[i].status = -EREMOTEIO; } } @@ -176,22 +168,26 @@ static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb, urb->status = -ENOENT; break; case CVMX_USB_COMPLETE_STALL: - DEBUG_ERROR("%s: status=stall pipe=%d submit=%d size=%d\n", __FUNCTION__, pipe_handle, submit_handle, bytes_transferred); + dev_dbg(dev, "status=stall pipe=%d submit=%d size=%d\n", + pipe_handle, submit_handle, bytes_transferred); urb->status = -EPIPE; break; case CVMX_USB_COMPLETE_BABBLEERR: - DEBUG_ERROR("%s: status=babble pipe=%d submit=%d size=%d\n", __FUNCTION__, pipe_handle, submit_handle, bytes_transferred); + dev_dbg(dev, "status=babble pipe=%d submit=%d size=%d\n", + pipe_handle, submit_handle, bytes_transferred); urb->status = -EPIPE; break; case CVMX_USB_COMPLETE_SHORT: - DEBUG_ERROR("%s: status=short pipe=%d submit=%d size=%d\n", __FUNCTION__, pipe_handle, submit_handle, bytes_transferred); + dev_dbg(dev, "status=short pipe=%d submit=%d size=%d\n", + pipe_handle, submit_handle, bytes_transferred); urb->status = -EREMOTEIO; break; case CVMX_USB_COMPLETE_ERROR: case CVMX_USB_COMPLETE_XACTERR: case CVMX_USB_COMPLETE_DATATGLERR: case CVMX_USB_COMPLETE_FRAMEERR: - DEBUG_ERROR("%s: status=%d pipe=%d submit=%d size=%d\n", __FUNCTION__, status, pipe_handle, submit_handle, bytes_transferred); + dev_dbg(dev, "status=%d pipe=%d submit=%d size=%d\n", + status, pipe_handle, submit_handle, bytes_transferred); urb->status = -EPROTO; break; } @@ -205,14 +201,13 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, gfp_t mem_flags) { struct octeon_hcd *priv = hcd_to_octeon(hcd); + struct device *dev = hcd->self.controller; int submit_handle = -1; int pipe_handle; unsigned long flags; cvmx_usb_iso_packet_t *iso_packet; struct usb_host_endpoint *ep = urb->ep; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); - urb->status = 0; INIT_LIST_HEAD(&urb->urb_list); /* not enqueued on dequeue_list */ spin_lock_irqsave(&priv->lock, flags); @@ -280,7 +275,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, split_port); if (pipe_handle < 0) { spin_unlock_irqrestore(&priv->lock, flags); - DEBUG_ERROR("OcteonUSB: %s failed to create pipe\n", __FUNCTION__); + dev_dbg(dev, "Failed to create pipe\n"); return -ENOMEM; } ep->hcpriv = (void *)(0x10000L + pipe_handle); @@ -290,7 +285,8 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, switch (usb_pipetype(urb->pipe)) { case PIPE_ISOCHRONOUS: - DEBUG_SUBMIT("OcteonUSB: %s submit isochronous to %d.%d\n", __FUNCTION__, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); + dev_dbg(dev, "Submit isochronous to %d.%d\n", + usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); /* Allocate a structure to use for our private list of isochronous packets */ iso_packet = kmalloc(urb->number_of_packets * sizeof(cvmx_usb_iso_packet_t), GFP_ATOMIC); @@ -323,7 +319,8 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, } break; case PIPE_INTERRUPT: - DEBUG_SUBMIT("OcteonUSB: %s submit interrupt to %d.%d\n", __FUNCTION__, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); + dev_dbg(dev, "Submit interrupt to %d.%d\n", + usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); submit_handle = cvmx_usb_submit_interrupt(&priv->usb, pipe_handle, urb->transfer_dma, urb->transfer_buffer_length, @@ -331,7 +328,8 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, urb); break; case PIPE_CONTROL: - DEBUG_SUBMIT("OcteonUSB: %s submit control to %d.%d\n", __FUNCTION__, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); + dev_dbg(dev, "Submit control to %d.%d\n", + usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); submit_handle = cvmx_usb_submit_control(&priv->usb, pipe_handle, urb->setup_dma, urb->transfer_dma, @@ -340,7 +338,8 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, urb); break; case PIPE_BULK: - DEBUG_SUBMIT("OcteonUSB: %s submit bulk to %d.%d\n", __FUNCTION__, usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); + dev_dbg(dev, "Submit bulk to %d.%d\n", + usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe)); submit_handle = cvmx_usb_submit_bulk(&priv->usb, pipe_handle, urb->transfer_dma, urb->transfer_buffer_length, @@ -350,7 +349,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd, } if (submit_handle < 0) { spin_unlock_irqrestore(&priv->lock, flags); - DEBUG_ERROR("OcteonUSB: %s failed to submit\n", __FUNCTION__); + dev_dbg(dev, "Failed to submit\n"); return -ENOMEM; } urb->hcpriv = (void *)(long)(((submit_handle & 0xffff) << 16) | pipe_handle); @@ -385,8 +384,6 @@ static int octeon_usb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int stat struct octeon_hcd *priv = hcd_to_octeon(hcd); unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); - if (!urb->dev) return -EINVAL; @@ -404,7 +401,8 @@ static int octeon_usb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int stat static void octeon_usb_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) { - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + struct device *dev = hcd->self.controller; + if (ep->hcpriv) { struct octeon_hcd *priv = hcd_to_octeon(hcd); int pipe_handle = 0xffff & (long)ep->hcpriv; @@ -412,7 +410,7 @@ static void octeon_usb_endpoint_disable(struct usb_hcd *hcd, struct usb_host_end spin_lock_irqsave(&priv->lock, flags); cvmx_usb_cancel_all(&priv->usb, pipe_handle); if (cvmx_usb_close_pipe(&priv->usb, pipe_handle)) - DEBUG_ERROR("OcteonUSB: Closing pipe %d failed\n", pipe_handle); + dev_dbg(dev, "Closing pipe %d failed\n", pipe_handle); spin_unlock_irqrestore(&priv->lock, flags); ep->hcpriv = NULL; } @@ -424,8 +422,6 @@ static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf) cvmx_usb_port_status_t port_status; unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); - spin_lock_irqsave(&priv->lock, flags); port_status = cvmx_usb_get_status(&priv->usb); spin_unlock_irqrestore(&priv->lock, flags); @@ -438,6 +434,7 @@ static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf) static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength) { struct octeon_hcd *priv = hcd_to_octeon(hcd); + struct device *dev = hcd->self.controller; cvmx_usb_port_status_t usb_port_status; int port_status; struct usb_hub_descriptor *desc; @@ -445,7 +442,7 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, switch (typeReq) { case ClearHubFeature: - DEBUG_ROOT_HUB("OcteonUSB: ClearHubFeature\n"); + dev_dbg(dev, "ClearHubFeature\n"); switch (wValue) { case C_HUB_LOCAL_POWER: case C_HUB_OVER_CURRENT: @@ -456,73 +453,72 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, } break; case ClearPortFeature: - DEBUG_ROOT_HUB("OcteonUSB: ClearPortFeature"); + dev_dbg(dev, "ClearPortFeature\n"); if (wIndex != 1) { - DEBUG_ROOT_HUB(" INVALID\n"); + dev_dbg(dev, " INVALID\n"); return -EINVAL; } switch (wValue) { case USB_PORT_FEAT_ENABLE: - DEBUG_ROOT_HUB(" ENABLE"); + dev_dbg(dev, " ENABLE\n"); spin_lock_irqsave(&priv->lock, flags); cvmx_usb_disable(&priv->usb); spin_unlock_irqrestore(&priv->lock, flags); break; case USB_PORT_FEAT_SUSPEND: - DEBUG_ROOT_HUB(" SUSPEND"); + dev_dbg(dev, " SUSPEND\n"); /* Not supported on Octeon */ break; case USB_PORT_FEAT_POWER: - DEBUG_ROOT_HUB(" POWER"); + dev_dbg(dev, " POWER\n"); /* Not supported on Octeon */ break; case USB_PORT_FEAT_INDICATOR: - DEBUG_ROOT_HUB(" INDICATOR"); + dev_dbg(dev, " INDICATOR\n"); /* Port inidicator not supported */ break; case USB_PORT_FEAT_C_CONNECTION: - DEBUG_ROOT_HUB(" C_CONNECTION"); + dev_dbg(dev, " C_CONNECTION\n"); /* Clears drivers internal connect status change flag */ spin_lock_irqsave(&priv->lock, flags); cvmx_usb_set_status(&priv->usb, cvmx_usb_get_status(&priv->usb)); spin_unlock_irqrestore(&priv->lock, flags); break; case USB_PORT_FEAT_C_RESET: - DEBUG_ROOT_HUB(" C_RESET"); + dev_dbg(dev, " C_RESET\n"); /* Clears the driver's internal Port Reset Change flag */ spin_lock_irqsave(&priv->lock, flags); cvmx_usb_set_status(&priv->usb, cvmx_usb_get_status(&priv->usb)); spin_unlock_irqrestore(&priv->lock, flags); break; case USB_PORT_FEAT_C_ENABLE: - DEBUG_ROOT_HUB(" C_ENABLE"); + dev_dbg(dev, " C_ENABLE\n"); /* Clears the driver's internal Port Enable/Disable Change flag */ spin_lock_irqsave(&priv->lock, flags); cvmx_usb_set_status(&priv->usb, cvmx_usb_get_status(&priv->usb)); spin_unlock_irqrestore(&priv->lock, flags); break; case USB_PORT_FEAT_C_SUSPEND: - DEBUG_ROOT_HUB(" C_SUSPEND"); + dev_dbg(dev, " C_SUSPEND\n"); /* Clears the driver's internal Port Suspend Change flag, which is set when resume signaling on the host port is complete */ break; case USB_PORT_FEAT_C_OVER_CURRENT: - DEBUG_ROOT_HUB(" C_OVER_CURRENT"); + dev_dbg(dev, " C_OVER_CURRENT\n"); /* Clears the driver's overcurrent Change flag */ spin_lock_irqsave(&priv->lock, flags); cvmx_usb_set_status(&priv->usb, cvmx_usb_get_status(&priv->usb)); spin_unlock_irqrestore(&priv->lock, flags); break; default: - DEBUG_ROOT_HUB(" UNKNOWN\n"); + dev_dbg(dev, " UNKNOWN\n"); return -EINVAL; } - DEBUG_ROOT_HUB("\n"); break; case GetHubDescriptor: - DEBUG_ROOT_HUB("OcteonUSB: GetHubDescriptor\n"); + dev_dbg(dev, "GetHubDescriptor\n"); desc = (struct usb_hub_descriptor *)buf; desc->bDescLength = 9; desc->bDescriptorType = 0x29; @@ -534,13 +530,13 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, desc->u.hs.DeviceRemovable[1] = 0xff; break; case GetHubStatus: - DEBUG_ROOT_HUB("OcteonUSB: GetHubStatus\n"); + dev_dbg(dev, "GetHubStatus\n"); *(__le32 *) buf = 0; break; case GetPortStatus: - DEBUG_ROOT_HUB("OcteonUSB: GetPortStatus"); + dev_dbg(dev, "GetPortStatus\n"); if (wIndex != 1) { - DEBUG_ROOT_HUB(" INVALID\n"); + dev_dbg(dev, " INVALID\n"); return -EINVAL; } @@ -551,82 +547,81 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, if (usb_port_status.connect_change) { port_status |= (1 << USB_PORT_FEAT_C_CONNECTION); - DEBUG_ROOT_HUB(" C_CONNECTION"); + dev_dbg(dev, " C_CONNECTION\n"); } if (usb_port_status.port_enabled) { port_status |= (1 << USB_PORT_FEAT_C_ENABLE); - DEBUG_ROOT_HUB(" C_ENABLE"); + dev_dbg(dev, " C_ENABLE\n"); } if (usb_port_status.connected) { port_status |= (1 << USB_PORT_FEAT_CONNECTION); - DEBUG_ROOT_HUB(" CONNECTION"); + dev_dbg(dev, " CONNECTION\n"); } if (usb_port_status.port_enabled) { port_status |= (1 << USB_PORT_FEAT_ENABLE); - DEBUG_ROOT_HUB(" ENABLE"); + dev_dbg(dev, " ENABLE\n"); } if (usb_port_status.port_over_current) { port_status |= (1 << USB_PORT_FEAT_OVER_CURRENT); - DEBUG_ROOT_HUB(" OVER_CURRENT"); + dev_dbg(dev, " OVER_CURRENT\n"); } if (usb_port_status.port_powered) { port_status |= (1 << USB_PORT_FEAT_POWER); - DEBUG_ROOT_HUB(" POWER"); + dev_dbg(dev, " POWER\n"); } if (usb_port_status.port_speed == CVMX_USB_SPEED_HIGH) { port_status |= USB_PORT_STAT_HIGH_SPEED; - DEBUG_ROOT_HUB(" HIGHSPEED"); + dev_dbg(dev, " HIGHSPEED\n"); } else if (usb_port_status.port_speed == CVMX_USB_SPEED_LOW) { port_status |= (1 << USB_PORT_FEAT_LOWSPEED); - DEBUG_ROOT_HUB(" LOWSPEED"); + dev_dbg(dev, " LOWSPEED\n"); } *((__le32 *) buf) = cpu_to_le32(port_status); - DEBUG_ROOT_HUB("\n"); break; case SetHubFeature: - DEBUG_ROOT_HUB("OcteonUSB: SetHubFeature\n"); + dev_dbg(dev, "SetHubFeature\n"); /* No HUB features supported */ break; case SetPortFeature: - DEBUG_ROOT_HUB("OcteonUSB: SetPortFeature"); + dev_dbg(dev, "SetPortFeature\n"); if (wIndex != 1) { - DEBUG_ROOT_HUB(" INVALID\n"); + dev_dbg(dev, " INVALID\n"); return -EINVAL; } switch (wValue) { case USB_PORT_FEAT_SUSPEND: - DEBUG_ROOT_HUB(" SUSPEND\n"); + dev_dbg(dev, " SUSPEND\n"); return -EINVAL; case USB_PORT_FEAT_POWER: - DEBUG_ROOT_HUB(" POWER\n"); + dev_dbg(dev, " POWER\n"); return -EINVAL; case USB_PORT_FEAT_RESET: - DEBUG_ROOT_HUB(" RESET\n"); + dev_dbg(dev, " RESET\n"); spin_lock_irqsave(&priv->lock, flags); cvmx_usb_disable(&priv->usb); if (cvmx_usb_enable(&priv->usb)) - DEBUG_ERROR("Failed to enable the port\n"); + dev_dbg(dev, "Failed to enable the port\n"); spin_unlock_irqrestore(&priv->lock, flags); return 0; case USB_PORT_FEAT_INDICATOR: - DEBUG_ROOT_HUB(" INDICATOR\n"); + dev_dbg(dev, " INDICATOR\n"); /* Not supported */ break; default: - DEBUG_ROOT_HUB(" UNKNOWN\n"); + dev_dbg(dev, " UNKNOWN\n"); return -EINVAL; } break; default: - DEBUG_ROOT_HUB("OcteonUSB: Unknown root hub request\n"); + dev_dbg(dev, "Unknown root hub request\n"); return -EINVAL; } return 0; @@ -659,8 +654,6 @@ static int octeon_usb_driver_probe(struct device *dev) struct usb_hcd *hcd; unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); - /* Set the DMA mask to 64bits so we get buffers already translated for DMA */ dev->coherent_dma_mask = ~0; @@ -668,7 +661,7 @@ static int octeon_usb_driver_probe(struct device *dev) hcd = usb_create_hcd(&octeon_hc_driver, dev, dev_name(dev)); if (!hcd) { - DEBUG_FATAL("OcteonUSB: Failed to allocate memory for HCD\n"); + dev_dbg(dev, "Failed to allocate memory for HCD\n"); return -1; } hcd->uses_new_polling = 1; @@ -682,7 +675,7 @@ static int octeon_usb_driver_probe(struct device *dev) //status = cvmx_usb_initialize(&priv->usb, usb_num, CVMX_USB_INITIALIZE_FLAGS_CLOCK_AUTO | CVMX_USB_INITIALIZE_FLAGS_DEBUG_INFO | CVMX_USB_INITIALIZE_FLAGS_DEBUG_TRANSFERS | CVMX_USB_INITIALIZE_FLAGS_DEBUG_CALLBACKS); status = cvmx_usb_initialize(&priv->usb, usb_num, CVMX_USB_INITIALIZE_FLAGS_CLOCK_AUTO); if (status) { - DEBUG_FATAL("OcteonUSB: USB initialization failed with %d\n", status); + dev_dbg(dev, "USB initialization failed with %d\n", status); kfree(hcd); return -1; } @@ -696,7 +689,7 @@ static int octeon_usb_driver_probe(struct device *dev) status = usb_add_hcd(hcd, irq, IRQF_SHARED); if (status) { - DEBUG_FATAL("OcteonUSB: USB add HCD failed with %d\n", status); + dev_dbg(dev, "USB add HCD failed with %d\n", status); kfree(hcd); return -1; } @@ -713,15 +706,13 @@ static int octeon_usb_driver_remove(struct device *dev) struct octeon_hcd *priv = hcd_to_octeon(hcd); unsigned long flags; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); - usb_remove_hcd(hcd); tasklet_kill(&priv->dequeue_tasklet); spin_lock_irqsave(&priv->lock, flags); status = cvmx_usb_shutdown(&priv->usb); spin_unlock_irqrestore(&priv->lock, flags); if (status) - DEBUG_FATAL("OcteonUSB: USB shutdown failed with %d\n", status); + dev_dbg(dev, "USB shutdown failed with %d\n", status); kfree(hcd); @@ -747,10 +738,9 @@ static int __init octeon_usb_module_init(void) if (usb_disabled() || num_devices == 0) return -ENODEV; - if (driver_register(&octeon_usb_driver)) { - DEBUG_FATAL("OcteonUSB: Failed to register driver\n"); + if (driver_register(&octeon_usb_driver)) return -ENOMEM; - } + octeon_usb_registered = 1; printk("OcteonUSB: Detected %d ports\n", num_devices); @@ -783,7 +773,6 @@ static int __init octeon_usb_module_init(void) irq_resource.flags = IORESOURCE_IRQ; pdev = platform_device_register_simple((char *)octeon_usb_driver. name, device, &irq_resource, 1); if (IS_ERR(pdev)) { - DEBUG_FATAL("OcteonUSB: Failed to allocate platform device for USB%d\n", device); driver_unregister(&octeon_usb_driver); octeon_usb_registered = 0; return PTR_ERR(pdev); @@ -798,7 +787,7 @@ static int __init octeon_usb_module_init(void) static void __exit octeon_usb_module_cleanup(void) { int i; - DEBUG_CALL("OcteonUSB: %s called\n", __FUNCTION__); + for (i = 0; i < MAX_USB_PORTS; i++) if (pdev_glob[i]) { platform_device_unregister(pdev_glob[i]); -- 2.30.2