summary refs log tree commit diff
path: root/arch/mips/cavium-octeon
diff options
context:
space:
mode:
authorQinglang Miao <miaoqinglang@huawei.com>2020-09-16 14:21:27 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-09-18 15:30:41 +0200
commit0ee69c589ec8659560910815f32c13af8587a779 (patch)
tree479cb74318ff51b7744c75cf246011a4cb50ce04 /arch/mips/cavium-octeon
parentb0a1c2903b5f43861a78a25fe4f389d99607ae04 (diff)
downloadlinux-0ee69c589ec8659560910815f32c13af8587a779.tar.gz
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: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/cavium-octeon')
-rw-r--r--arch/mips/cavium-octeon/octeon-usb.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 950e6c6e8629..97f6dc31e1b4 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -498,7 +498,6 @@ static int __init dwc3_octeon_device_init(void)
 	const char compat_node_name[] = "cavium,octeon-7130-usb-uctl";
 	struct platform_device *pdev;
 	struct device_node *node;
-	struct resource *res;
 	void __iomem *base;
 
 	/*
@@ -516,20 +515,13 @@ static int __init dwc3_octeon_device_init(void)
 			if (!pdev)
 				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
 			 * setting up the clocks and reseting PHYs. We must
 			 * release the resources so the dwc3 subsystem doesn't
 			 * know the difference.
 			 */
-			base = devm_ioremap_resource(&pdev->dev, res);
+			base = devm_platform_ioremap_resource(pdev, 0);
 			if (IS_ERR(base)) {
 				put_device(&pdev->dev);
 				return PTR_ERR(base);