summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-platform.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-08-06 18:06:53 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-10 12:05:32 -0700
commit86e4cb35f2260374df4139c2352afe7fe247cb60 (patch)
tree2667b17c0fb1fe6832a156463a69f348915b2ab5 /drivers/usb/host/ehci-platform.c
parent6df471ea04bd65603b67d821f2df359cc2cfac68 (diff)
usb: host: ehci-platform: BUG_ON() to WARN_ON() on probe
usb_ehci_pdata is certainly required in ehci-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/ehci-platform.c')
-rw-r--r--drivers/usb/host/ehci-platform.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 4b1d896d5a22..a2aaef618aea 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -82,10 +82,14 @@ static int __devinit ehci_platform_probe(struct platform_device *dev)
{
struct usb_hcd *hcd;
struct resource *res_mem;
+ struct usb_ehci_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;