host: ohci-da8xx: remove duplicate check on resource
authorVarka Bhadram <varkab@cdac.in>
Tue, 4 Nov 2014 02:21:09 +0000 (07:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:01:49 +0000 (09:01 -0800)
Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-da8xx.c

index df06be6..1c76999 100644 (file)
@@ -313,16 +313,13 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
                return -ENOMEM;
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!mem)
-               return -ENODEV;
-       hcd->rsrc_start = mem->start;
-       hcd->rsrc_len = resource_size(mem);
-
        hcd->regs = devm_ioremap_resource(&pdev->dev, mem);
        if (IS_ERR(hcd->regs)) {
                error = PTR_ERR(hcd->regs);
                goto err;
        }
+       hcd->rsrc_start = mem->start;
+       hcd->rsrc_len = resource_size(mem);
 
        ohci_hcd_init(hcd_to_ohci(hcd));