summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLv Ruyi <lv.ruyi@zte.com.cn>2022-04-21 08:46:21 +0000
committerBorislav Petkov <bp@suse.de>2022-04-29 11:14:08 +0200
commit2f58783c5d8882273eb0c872d19bb89954d466e8 (patch)
treeebffcce7755c56568e46a6eba3b5a9872533aa27 /drivers
parent9ae83ec8b81dcd0a1c5d07a44e3b8d06311546d9 (diff)
downloadlinux-2f58783c5d8882273eb0c872d19bb89954d466e8.tar.gz
linux-2f58783c5d8882273eb0c872d19bb89954d466e8.tar.bz2
linux-2f58783c5d8882273eb0c872d19bb89954d466e8.zip
EDAC/armada_xp: Use devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Make the code simpler without functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Jan Luebbe <jlu@pengutronix.de> Link: https://lore.kernel.org/r/20220421084621.2615517-1-lv.ruyi@zte.com.cn
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/armada_xp_edac.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c
index b1f46a974b9e..038abbb83f4b 100644
--- a/drivers/edac/armada_xp_edac.c
+++ b/drivers/edac/armada_xp_edac.c
@@ -286,17 +286,10 @@ static int axp_mc_probe(struct platform_device *pdev)
struct edac_mc_layer layers[1];
const struct of_device_id *id;
struct mem_ctl_info *mci;
- struct resource *r;
void __iomem *base;
uint32_t config;
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r) {
- dev_err(&pdev->dev, "Unable to get mem resource\n");
- return -ENODEV;
- }
-
- base = devm_ioremap_resource(&pdev->dev, r);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
dev_err(&pdev->dev, "Unable to map regs\n");
return PTR_ERR(base);
@@ -516,15 +509,8 @@ static int aurora_l2_probe(struct platform_device *pdev)
const struct of_device_id *id;
uint32_t l2x0_aux_ctrl;
void __iomem *base;
- struct resource *r;
-
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r) {
- dev_err(&pdev->dev, "Unable to get mem resource\n");
- return -ENODEV;
- }
- base = devm_ioremap_resource(&pdev->dev, r);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
dev_err(&pdev->dev, "Unable to map regs\n");
return PTR_ERR(base);