diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-24 22:18:03 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-24 22:18:03 +0400 |
commit | 99f14bd4d1b2a1b1b6cd508e08efdbc5e3919198 (patch) | |
tree | a81b9b315127132a84454746043c98990bcd56b9 /drivers/usb/host/ohci-at91.c | |
parent | 3482528e9aced9234d4e2a4a9538c882a9aa5aa2 (diff) | |
parent | 413541dd66d51f791a0b169d9b9014e4f56be13c (diff) | |
download | linux-99f14bd4d1b2a1b1b6cd508e08efdbc5e3919198.tar.xz |
Merge 3.13-rc5 into usb-next
This resolves the merge issue with drivers/usb/host/ohci-at91.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-at91.c')
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 6d4cf931de5b..2d0ee5e3127c 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -136,23 +136,27 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, struct ohci_hcd *ohci; int retval; struct usb_hcd *hcd = NULL; - - if (pdev->num_resources != 2) { - pr_debug("hcd probe: invalid num_resources"); - return -ENODEV; + struct device *dev = &pdev->dev; + struct resource *res; + int irq; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_dbg(dev, "hcd probe: missing memory resource\n"); + return -ENXIO; } - if ((pdev->resource[0].flags != IORESOURCE_MEM) - || (pdev->resource[1].flags != IORESOURCE_IRQ)) { - pr_debug("hcd probe: invalid resource type\n"); - return -ENODEV; + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + dev_dbg(dev, "hcd probe: missing irq resource\n"); + return irq; } hcd = usb_create_hcd(driver, dev, "at91"); if (!hcd) return -ENOMEM; - hcd->rsrc_start = pdev->resource[0].start; - hcd->rsrc_len = resource_size(&pdev->resource[0]); + hcd->rsrc_start = res->start; + hcd->rsrc_len = resource_size(res); hcd->regs = devm_ioremap_resource(dev, res); if (IS_ERR(hcd->regs)) { @@ -192,8 +196,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, ohci->num_ports = board->ports; at91_start_hc(pdev); - retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); - if (retval == 0) { + retval = usb_add_hcd(hcd, irq, IRQF_SHARED); + if (retval == 0) device_wakeup_enable(hcd->self.controller); return retval; } |