Skip to content

Commit

Permalink
host: ehci-sh: remove duplicate check on resource
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Varka Bhadram authored and Greg Kroah-Hartman committed Nov 7, 2014
1 parent 15c85d9 commit e71827f
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/usb/host/ehci-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
if (usb_disabled())
return -ENODEV;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev,
"Found HC with no register addr. Check %s setup!\n",
dev_name(&pdev->dev));
ret = -ENODEV;
goto fail_create_hcd;
}

irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(&pdev->dev,
Expand All @@ -114,14 +105,14 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
goto fail_create_hcd;
}

hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs);
goto fail_request_resource;
}
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);

priv = devm_kzalloc(&pdev->dev, sizeof(struct ehci_sh_priv),
GFP_KERNEL);
Expand Down

0 comments on commit e71827f

Please sign in to comment.