lkml.org 
[lkml]   [2021]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] bus: fsl-mc: fsl-mc-bus: Use devm_platform_ioremap_resource() to simplify code
Date
Use devm_platform_ioremap_resource() instead of
platform_get_resource() + devm_ioremap_resource().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 380ad1fdb745..472f0daf4271 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -1080,12 +1080,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, mc);

- plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- if (plat_res) {
- mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev, plat_res);
- if (IS_ERR(mc->fsl_mc_regs))
- return PTR_ERR(mc->fsl_mc_regs);
- }
+ mc->fsl_mc_regs = devm_platform_ioremap_resource(pdev, 1);
+ if (IS_ERR(mc->fsl_mc_regs))
+ return PTR_ERR(mc->fsl_mc_regs);

if (mc->fsl_mc_regs) {
/*
--
2.18.2


\
 
 \ /
  Last update: 2021-06-28 16:49    [W:0.117 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site