aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-at91.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-24 13:18:03 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-24 13:18:03 -0500
commit99f14bd4d1b2a1b1b6cd508e08efdbc5e3919198 (patch)
treea81b9b315127132a84454746043c98990bcd56b9 /drivers/usb/host/ohci-at91.c
parent3482528e9aced9234d4e2a4a9538c882a9aa5aa2 (diff)
parent413541dd66d51f791a0b169d9b9014e4f56be13c (diff)
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.c28
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,
136 struct ohci_hcd *ohci; 136 struct ohci_hcd *ohci;
137 int retval; 137 int retval;
138 struct usb_hcd *hcd = NULL; 138 struct usb_hcd *hcd = NULL;
139 139 struct device *dev = &pdev->dev;
140 if (pdev->num_resources != 2) { 140 struct resource *res;
141 pr_debug("hcd probe: invalid num_resources"); 141 int irq;
142 return -ENODEV; 142
143 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
144 if (!res) {
145 dev_dbg(dev, "hcd probe: missing memory resource\n");
146 return -ENXIO;
143 } 147 }
144 148
145 if ((pdev->resource[0].flags != IORESOURCE_MEM) 149 irq = platform_get_irq(pdev, 0);
146 || (pdev->resource[1].flags != IORESOURCE_IRQ)) { 150 if (irq < 0) {
147 pr_debug("hcd probe: invalid resource type\n"); 151 dev_dbg(dev, "hcd probe: missing irq resource\n");
148 return -ENODEV; 152 return irq;
149 } 153 }
150 154
151 hcd = usb_create_hcd(driver, dev, "at91"); 155 hcd = usb_create_hcd(driver, dev, "at91");
152 if (!hcd) 156 if (!hcd)
153 return -ENOMEM; 157 return -ENOMEM;
154 hcd->rsrc_start = pdev->resource[0].start; 158 hcd->rsrc_start = res->start;
155 hcd->rsrc_len = resource_size(&pdev->resource[0]); 159 hcd->rsrc_len = resource_size(res);
156 160
157 hcd->regs = devm_ioremap_resource(dev, res); 161 hcd->regs = devm_ioremap_resource(dev, res);
158 if (IS_ERR(hcd->regs)) { 162 if (IS_ERR(hcd->regs)) {
@@ -192,8 +196,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
192 ohci->num_ports = board->ports; 196 ohci->num_ports = board->ports;
193 at91_start_hc(pdev); 197 at91_start_hc(pdev);
194 198
195 retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); 199 retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
196 if (retval == 0) { 200 if (retval == 0)
197 device_wakeup_enable(hcd->self.controller); 201 device_wakeup_enable(hcd->self.controller);
198 return retval; 202 return retval;
199 } 203 }