Commit 0ee69c58 authored by Qinglang Miao's avatar Qinglang Miao Committed by Thomas Bogendoerfer

MIPS: OCTEON: use devm_platform_ioremap_resource

Note that error handling on the result of a call to platform_get_resource()
is unneeded when the value is passed to devm_ioremap_resource(), so remove
it. Then use the helper function that wraps the calls to
platform_get_resource() and devm_ioremap_resource() together.
Signed-off-by: default avatarQinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent b0a1c290
...@@ -498,7 +498,6 @@ static int __init dwc3_octeon_device_init(void) ...@@ -498,7 +498,6 @@ static int __init dwc3_octeon_device_init(void)
const char compat_node_name[] = "cavium,octeon-7130-usb-uctl"; const char compat_node_name[] = "cavium,octeon-7130-usb-uctl";
struct platform_device *pdev; struct platform_device *pdev;
struct device_node *node; struct device_node *node;
struct resource *res;
void __iomem *base; void __iomem *base;
/* /*
...@@ -516,20 +515,13 @@ static int __init dwc3_octeon_device_init(void) ...@@ -516,20 +515,13 @@ static int __init dwc3_octeon_device_init(void)
if (!pdev) if (!pdev)
return -ENODEV; return -ENODEV;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
put_device(&pdev->dev);
dev_err(&pdev->dev, "No memory resources\n");
return -ENXIO;
}
/* /*
* The code below maps in the registers necessary for * The code below maps in the registers necessary for
* setting up the clocks and reseting PHYs. We must * setting up the clocks and reseting PHYs. We must
* release the resources so the dwc3 subsystem doesn't * release the resources so the dwc3 subsystem doesn't
* know the difference. * know the difference.
*/ */
base = devm_ioremap_resource(&pdev->dev, res); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) { if (IS_ERR(base)) {
put_device(&pdev->dev); put_device(&pdev->dev);
return PTR_ERR(base); return PTR_ERR(base);
......
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