diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2014-11-03 21:21:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-07 12:01:50 -0500 |
commit | e71827f49415b9da0b4723cab398258c9a40ed08 (patch) | |
tree | 6101acc1280b696fe1ef2b55a792f48ef2a29b93 /drivers/usb/host/ehci-sh.c | |
parent | 15c85d9cc83b6aea97859377d887e7493f141193 (diff) |
host: ehci-sh: 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>
Diffstat (limited to 'drivers/usb/host/ehci-sh.c')
-rw-r--r-- | drivers/usb/host/ehci-sh.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index f9ebf8af99b9..0e0ce684aff3 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c | |||
@@ -86,15 +86,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
86 | if (usb_disabled()) | 86 | if (usb_disabled()) |
87 | return -ENODEV; | 87 | return -ENODEV; |
88 | 88 | ||
89 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
90 | if (!res) { | ||
91 | dev_err(&pdev->dev, | ||
92 | "Found HC with no register addr. Check %s setup!\n", | ||
93 | dev_name(&pdev->dev)); | ||
94 | ret = -ENODEV; | ||
95 | goto fail_create_hcd; | ||
96 | } | ||
97 | |||
98 | irq = platform_get_irq(pdev, 0); | 89 | irq = platform_get_irq(pdev, 0); |
99 | if (irq <= 0) { | 90 | if (irq <= 0) { |
100 | dev_err(&pdev->dev, | 91 | dev_err(&pdev->dev, |
@@ -114,14 +105,14 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
114 | goto fail_create_hcd; | 105 | goto fail_create_hcd; |
115 | } | 106 | } |
116 | 107 | ||
117 | hcd->rsrc_start = res->start; | 108 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
118 | hcd->rsrc_len = resource_size(res); | ||
119 | |||
120 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); | 109 | hcd->regs = devm_ioremap_resource(&pdev->dev, res); |
121 | if (IS_ERR(hcd->regs)) { | 110 | if (IS_ERR(hcd->regs)) { |
122 | ret = PTR_ERR(hcd->regs); | 111 | ret = PTR_ERR(hcd->regs); |
123 | goto fail_request_resource; | 112 | goto fail_request_resource; |
124 | } | 113 | } |
114 | hcd->rsrc_start = res->start; | ||
115 | hcd->rsrc_len = resource_size(res); | ||
125 | 116 | ||
126 | priv = devm_kzalloc(&pdev->dev, sizeof(struct ehci_sh_priv), | 117 | priv = devm_kzalloc(&pdev->dev, sizeof(struct ehci_sh_priv), |
127 | GFP_KERNEL); | 118 | GFP_KERNEL); |