diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-08-07 05:07:30 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-10 23:05:32 +0400 |
commit | b6dd245c4594482d46507a0bfd100439be367952 (patch) | |
tree | def53c96054733d2dea8e07caba0096a308b4c52 /drivers/usb/host/ohci-platform.c | |
parent | 86e4cb35f2260374df4139c2352afe7fe247cb60 (diff) | |
download | linux-b6dd245c4594482d46507a0bfd100439be367952.tar.xz |
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 <kuninori.morimoto.gx@renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-platform.c')
-rw-r--r-- | drivers/usb/host/ohci-platform.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |