summaryrefslogtreecommitdiff
path: root/arch/mips/cavium-octeon
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-09-23 09:26:44 +0200
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-09-23 09:26:44 +0200
commit063a9966ee1555db2375fa21339199578974b725 (patch)
tree3c6d2475a51c8261ba0a1d7f4b507a8b3f00de6c /arch/mips/cavium-octeon
parent262623961478836b0f467f9bbb9a3dd2a0c8a9be (diff)
downloadlwn-063a9966ee1555db2375fa21339199578974b725.tar.gz
lwn-063a9966ee1555db2375fa21339199578974b725.zip
Revert "MIPS: OCTEON: use devm_platform_ioremap_resource"
This reverts commit 0ee69c589ec8659560910815f32c13af8587a779. Resource is still needed later in the code, so using devm_platform_ioremap_resource is no win at all. 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, 9 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 97f6dc31e1b4..950e6c6e8629 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -498,6 +498,7 @@ 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;
/*
@@ -515,13 +516,20 @@ 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_platform_ioremap_resource(pdev, 0);
+ base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) {
put_device(&pdev->dev);
return PTR_ERR(base);