Minor clenaup in the AMD Alchemy Au1xxx HCD bus glue -
1. Make use platform_get_irq/resource() functions.
2. Remove unnecessary parameter in usb_ehci_au1xxx_probe().
Signed-off-by: Subhash Peddamallu <[EMAIL PROTECTED]>
---
--- linux-2.6.19-rc5/drivers/usb/host/ehci-au1xxx.c.orig
2006-11-15 01:23:29.000000000 -0500
+++ linux-2.6.19-rc5/drivers/usb/host/ehci-au1xxx.c 2006-11-15
01:53:41.000000000 -0500
@@ -95,11 +95,13 @@ static void au1xxx_stop_ehc(struct platf
*
*/
int usb_ehci_au1xxx_probe(const struct hc_driver *driver,
- struct usb_hcd **hcd_out, struct platform_device *dev)
+ struct platform_device *dev)
{
int retval;
struct usb_hcd *hcd;
struct ehci_hcd *ehci;
+ struct resource *res;
+ int irq;
#if defined(CONFIG_SOC_AU1200) && defined(CONFIG_DMA_COHERENT)
@@ -114,15 +116,25 @@ int usb_ehci_au1xxx_probe(const struct h
au1xxx_start_ehc(dev);
- if (dev->resource[1].flags != IORESOURCE_IRQ) {
- pr_debug("resource[1] is not IORESOURCE_IRQ");
- retval = -ENOMEM;
+ irq = platform_get_irq(dev, IORESOURCE_IRQ, 0);
+ if (irq < 0) {
+ pr_debug("%s: Found HC with no IRQ. Check setup!\n",
+ dev->name);
+ return -ENODEV;
}
hcd = usb_create_hcd(driver, &dev->dev, "Au1xxx");
if (!hcd)
return -ENOMEM;
- hcd->rsrc_start = dev->resource[0].start;
- hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
+
+ res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ if (!res) {
+ pr_debug("%s: Found HC with no register addr. Check setup!\n",
+ dev->name);
+ retval = -ENODEV;
+ goto err1;
+ }
+ hcd->rsrc_start = res->start;
+ hcd->rsrc_len = res->end - res->start + 1;
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
pr_debug("request_mem_region failed");
@@ -146,7 +158,7 @@ int usb_ehci_au1xxx_probe(const struct h
/* ehci_hcd_init(hcd_to_ehci(hcd)); */
retval =
- usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED |
IRQF_SHARED);
+ usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
if (retval == 0)
return retval;
@@ -229,7 +241,6 @@ static const struct hc_driver ehci_au1xx
static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
{
- struct usb_hcd *hcd = NULL;
int ret;
pr_debug("In ehci_hcd_au1xxx_drv_probe\n");
@@ -237,7 +248,7 @@ static int ehci_hcd_au1xxx_drv_probe(str
if (usb_disabled())
return -ENODEV;
- ret = usb_ehci_au1xxx_probe(&ehci_au1xxx_hc_driver, &hcd, pdev);
+ ret = usb_ehci_au1xxx_probe(&ehci_au1xxx_hc_driver, pdev);
return ret;
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel