From: Kuninori Morimoto Date: Tue, 7 Aug 2012 01:07:30 +0000 (-0700) Subject: usb: host: ohci-platform: BUG_ON() to WARN_ON() on probe X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b6dd245c4594482d46507a0bfd100439be367952;p=linux-beck.git usb: host: ohci-platform: BUG_ON() to WARN_ON() on probe usb_ohci_pdata is certainly required in ohci-platform driver. This patch avoids using BUG_ON() from driver, and return from probe with WARN_ON() if pdata was NULL. Signed-off-by: Kuninori Morimoto Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 670c7059c9ae..4c886f938f6c 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -83,10 +83,14 @@ static int __devinit ohci_platform_probe(struct platform_device *dev) { struct usb_hcd *hcd; struct resource *res_mem; + struct usb_ohci_pdata *pdata = dev->dev.platform_data; int irq; int err = -ENOMEM; - BUG_ON(!dev->dev.platform_data); + if (!pdata) { + WARN_ON(1); + return -ENODEV; + } if (usb_disabled()) return -ENODEV;