Browse Source

usb: gadget: amd5536udc: use WARN_ON

Use WARN_ON() instead of halting the kernel with BUG_ON() and also fix
the checkpatch warning.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Sudip Mukherjee 10 years ago
parent
commit
2e1b7d0c69
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/usb/gadget/udc/amd5536udc.c

+ 2 - 1
drivers/usb/gadget/udc/amd5536udc.c

@@ -3127,7 +3127,8 @@ static void udc_pci_remove(struct pci_dev *pdev)
 
 	usb_del_gadget_udc(&udc->gadget);
 	/* gadget driver must not be registered */
-	BUG_ON(dev->driver != NULL);
+	if (WARN_ON(dev->driver))
+		return;
 
 	/* dma pool cleanup */
 	if (dev->data_requests)