summaryrefslogtreecommitdiff
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorDejin Zheng <zhengdejin5@gmail.com>2020-03-24 00:06:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-24 12:09:40 +0100
commitfd78901c297ee1a3214f617d4afb83a467aa7ada (patch)
tree314de543eef22e07b310ce927d0529295c0cc98c /drivers/base/platform.c
parent5bf7e2883f1242d056538af4500d4ff81542a48b (diff)
driver core: platform: Reimplement devm_platform_ioremap_resource
Reimplement devm_platform_ioremap_resource() by calling devm_platform_ioremap_and_get_resource() with res = NULL to simplify the code. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Link: https://lore.kernel.org/r/20200323160612.17277-6-zhengdejin5@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 8f0f62bdc58e..5255550b7c34 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -95,10 +95,7 @@ EXPORT_SYMBOL_GPL(devm_platform_get_and_ioremap_resource);
void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index)
{
- struct resource *res;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- return devm_ioremap_resource(&pdev->dev, res);
+ return devm_platform_get_and_ioremap_resource(pdev, index, NULL);
}
EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);