Commit 0af6b070 authored by Varka Bhadram's avatar Varka Bhadram Committed by Greg Kroah-Hartman

host: ehci-w90x900: remove duplicate check on resource

Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a36cc423
...@@ -42,27 +42,20 @@ static int usb_w90x900_probe(const struct hc_driver *driver, ...@@ -42,27 +42,20 @@ static int usb_w90x900_probe(const struct hc_driver *driver,
int retval = 0, irq; int retval = 0, irq;
unsigned long val; unsigned long val;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
retval = -ENXIO;
goto err1;
}
hcd = usb_create_hcd(driver, &pdev->dev, "w90x900 EHCI"); hcd = usb_create_hcd(driver, &pdev->dev, "w90x900 EHCI");
if (!hcd) { if (!hcd) {
retval = -ENOMEM; retval = -ENOMEM;
goto err1; goto err1;
} }
hcd->rsrc_start = res->start; res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hcd->rsrc_len = resource_size(res);
hcd->regs = devm_ioremap_resource(&pdev->dev, res); hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hcd->regs)) { if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs); retval = PTR_ERR(hcd->regs);
goto err2; goto err2;
} }
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
ehci = hcd_to_ehci(hcd); ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs; ehci->caps = hcd->regs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment