Commit 2f58783c authored by Lv Ruyi's avatar Lv Ruyi Committed by Borislav Petkov

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: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarJan Luebbe <jlu@pengutronix.de>
Link: https://lore.kernel.org/r/20220421084621.2615517-1-lv.ruyi@zte.com.cn
parent 9ae83ec8
...@@ -286,17 +286,10 @@ static int axp_mc_probe(struct platform_device *pdev) ...@@ -286,17 +286,10 @@ static int axp_mc_probe(struct platform_device *pdev)
struct edac_mc_layer layers[1]; struct edac_mc_layer layers[1];
const struct of_device_id *id; const struct of_device_id *id;
struct mem_ctl_info *mci; struct mem_ctl_info *mci;
struct resource *r;
void __iomem *base; void __iomem *base;
uint32_t config; uint32_t config;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
if (!r) {
dev_err(&pdev->dev, "Unable to get mem resource\n");
return -ENODEV;
}
base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(base)) { if (IS_ERR(base)) {
dev_err(&pdev->dev, "Unable to map regs\n"); dev_err(&pdev->dev, "Unable to map regs\n");
return PTR_ERR(base); return PTR_ERR(base);
...@@ -516,15 +509,8 @@ static int aurora_l2_probe(struct platform_device *pdev) ...@@ -516,15 +509,8 @@ static int aurora_l2_probe(struct platform_device *pdev)
const struct of_device_id *id; const struct of_device_id *id;
uint32_t l2x0_aux_ctrl; uint32_t l2x0_aux_ctrl;
void __iomem *base; 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)) { if (IS_ERR(base)) {
dev_err(&pdev->dev, "Unable to map regs\n"); dev_err(&pdev->dev, "Unable to map regs\n");
return PTR_ERR(base); return PTR_ERR(base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment