提交 86e4cb35 编写于 作者: K Kuninori Morimoto 提交者: Greg Kroah-Hartman

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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6df471ea
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册