Skip to content

Commit 2f58783

Browse files
Lv Ruyisuryasaimadhu
authored andcommitted
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
1 parent 9ae83ec commit 2f58783

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

drivers/edac/armada_xp_edac.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,10 @@ static int axp_mc_probe(struct platform_device *pdev)
286286
struct edac_mc_layer layers[1];
287287
const struct of_device_id *id;
288288
struct mem_ctl_info *mci;
289-
struct resource *r;
290289
void __iomem *base;
291290
uint32_t config;
292291

293-
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
294-
if (!r) {
295-
dev_err(&pdev->dev, "Unable to get mem resource\n");
296-
return -ENODEV;
297-
}
298-
299-
base = devm_ioremap_resource(&pdev->dev, r);
292+
base = devm_platform_ioremap_resource(pdev, 0);
300293
if (IS_ERR(base)) {
301294
dev_err(&pdev->dev, "Unable to map regs\n");
302295
return PTR_ERR(base);
@@ -516,15 +509,8 @@ static int aurora_l2_probe(struct platform_device *pdev)
516509
const struct of_device_id *id;
517510
uint32_t l2x0_aux_ctrl;
518511
void __iomem *base;
519-
struct resource *r;
520-
521-
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
522-
if (!r) {
523-
dev_err(&pdev->dev, "Unable to get mem resource\n");
524-
return -ENODEV;
525-
}
526512

527-
base = devm_ioremap_resource(&pdev->dev, r);
513+
base = devm_platform_ioremap_resource(pdev, 0);
528514
if (IS_ERR(base)) {
529515
dev_err(&pdev->dev, "Unable to map regs\n");
530516
return PTR_ERR(base);

0 commit comments

Comments
 (0)