mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 15:02:32 +00:00
c0e1a6f342
Backport of upstream commits: 86e4cb35f2260374df4139c2352afe7fe247cb60 usb: host: ehci-platform: BUG_ON() to WARN_ON() on probe b6dd245c4594482d46507a0bfd100439be367952 usb: host: ohci-platform: BUG_ON() to WARN_ON() on probe 04216bedafb1b3992a6c2b7f1518281d2ba5fc7b usb: host: ehci-platform: add platform specific power callback e4d37aeb373a5edceecc1dadc76fabbe8bc18e44 usb: host: ohci-platform: addplatform specific power callback Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34842
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
From 86e4cb35f2260374df4139c2352afe7fe247cb60 Mon Sep 17 00:00:00 2001
|
|
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
|
Date: Mon, 6 Aug 2012 18:06:53 -0700
|
|
Subject: [PATCH] usb: host: ehci-platform: BUG_ON() to WARN_ON() on probe
|
|
|
|
Commit 86e4cb35f2260374df4139c2352afe7fe247cb60 upstream.
|
|
|
|
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>
|
|
---
|
|
drivers/usb/host/ehci-platform.c | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
--- 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 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;
|