Skip to content

Commit

Permalink
usb: host: ohci-platform: BUG_ON() to WARN_ON() on probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Greg Kroah-Hartman committed Aug 10, 2012
1 parent 86e4cb3 commit b6dd245
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/host/ohci-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6dd245

Please sign in to comment.