[PATCH] USB: Fix oops at rmmod after failed probe in isp116x-hcd
This patch fixes an oops triggered at rmmod of isp116x-hcd
after the probe() has failed.
Also, it extends the error message printed, if the driver
cannot detect "Chip's Clock Ready" after a software reset.
As Ian Campbell recently reported, this happens if the
chip's H_WAKEUP pin is not pulled low during software reset.
Several people have already had this issue, hence the update
to the error message.
Also, extend the error message about the failed clock
detection after the software reset.
Signed-off-by: Olav Kongas <[EMAIL PROTECTED]>
---
commit 589a0083a3c9e9610e54984998a46c07a2584b55
tree 285700641afef15c85a9c7ab275dd7d376fb05e0
parent 4808a1c0261176f9c7e28e7f108d41a381a7d0fc
author Olav Kongas <[EMAIL PROTECTED]> Thu, 21 Apr 2005 17:12:59 +0300
committer Greg Kroah-Hartman <[EMAIL PROTECTED]> Mon, 27 Jun 2005 14:43:42 -0700
drivers/usb/host/isp116x-hcd.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1501,6 +1501,12 @@ static int isp116x_reset(struct usb_hcd
}
if (!clkrdy) {
ERR("Clock not ready after 20ms\n");
+ /* After sw_reset the clock won't report to be ready, if
+ H_WAKEUP pin is high. */
+ if (!isp116x->board || !isp116x->board->reset)
+ ERR("The driver does not support hardware wakeup.\n");
+ ERR("Please make sure that the H_WAKEUP pin "
+ "is pulled low!\n");
ret = -ENODEV;
}
return ret;
@@ -1678,10 +1684,13 @@ static struct hc_driver isp116x_hc_drive
static int __init_or_module isp116x_remove(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
- struct isp116x *isp116x = hcd_to_isp116x(hcd);
+ struct isp116x *isp116x;
struct platform_device *pdev;
struct resource *res;
+ if(!hcd)
+ return 0;
+ isp116x = hcd_to_isp116x(hcd);
pdev = container_of(dev, struct platform_device, dev);
remove_debug_file(isp116x);
usb_remove_hcd(hcd);
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel