projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branches 'regulator/topic/db8500', 'regulator/topic/gpio',...
[linux-2.6-microblaze.git]
/
drivers
/
usb
/
host
/
ohci-at91.c
diff --git
a/drivers/usb/host/ohci-at91.c
b/drivers/usb/host/ohci-at91.c
index
418444e
..
8c356af
100644
(file)
--- 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;
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;
}
}
- i
f ((pdev->resource[0].flags != IORESOURCE_MEM)
-
|| (pdev->resource[1].flags != IORESOURCE_IRQ)
) {
-
pr_debug("hcd probe: invalid resource typ
e\n");
- return
-ENODEV
;
+ i
rq = platform_get_irq(pdev, 0);
+
if (irq < 0
) {
+
dev_dbg(dev, "hcd probe: missing irq resourc
e\n");
+ return
irq
;
}
hcd = usb_create_hcd(driver, &pdev->dev, "at91");
if (!hcd)
return -ENOMEM;
}
hcd = usb_create_hcd(driver, &pdev->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
);
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
pr_debug("request_mem_region failed\n");
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
pr_debug("request_mem_region failed\n");
@@
-199,7
+203,7
@@
static int usb_hcd_at91_probe(const struct hc_driver *driver,
ohci->num_ports = board->ports;
at91_start_hc(pdev);
ohci->num_ports = board->ports;
at91_start_hc(pdev);
- retval = usb_add_hcd(hcd,
pdev->resource[1].start
, IRQF_SHARED);
+ retval = usb_add_hcd(hcd,
irq
, IRQF_SHARED);
if (retval == 0)
return retval;
if (retval == 0)
return retval;