summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarka Bhadram <varkabhadram@gmail.com>2014-11-04 03:21:15 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 18:01:50 +0100
commitc6d413cebd82cf35b6a4257cd94724ff60cffb71 (patch)
tree42a5c7bd5db2ff8563c80eb0371e03fa4c2d047c
parenthost: ohci-jz4740: remove duplicate check on resource (diff)
downloadlinux-c6d413cebd82cf35b6a4257cd94724ff60cffb71.tar.xz
linux-c6d413cebd82cf35b6a4257cd94724ff60cffb71.zip
host: ohci-octeon: remove duplicate check on resource
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>
-rw-r--r--drivers/usb/host/ohci-octeon.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-octeon.c b/drivers/usb/host/ohci-octeon.c
index 15af8954085e..20d861b6192f 100644
--- a/drivers/usb/host/ohci-octeon.c
+++ b/drivers/usb/host/ohci-octeon.c
@@ -120,12 +120,6 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)
return -ENODEV;
}
- res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res_mem == NULL) {
- dev_err(&pdev->dev, "No register space assigned\n");
- return -ENODEV;
- }
-
/* Ohci is a 32-bit device. */
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
@@ -135,14 +129,14 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)
if (!hcd)
return -ENOMEM;
- hcd->rsrc_start = res_mem->start;
- hcd->rsrc_len = resource_size(res_mem);
-
+ res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg_base = devm_ioremap_resource(&pdev->dev, res_mem);
if (IS_ERR(reg_base)) {
ret = PTR_ERR(reg_base);
goto err1;
}
+ hcd->rsrc_start = res_mem->start;
+ hcd->rsrc_len = resource_size(res_mem);
ohci_octeon_hw_start();