diff mbox series

EDAC: BlueField: Use devm_platform_ioremap_resource() in bluefield_edac_mc_probe()

Message ID cda92ed6-feb8-87a0-1477-1f784e3dc576@web.de (mailing list archive)
State New, archived
Headers show
Series EDAC: BlueField: Use devm_platform_ioremap_resource() in bluefield_edac_mc_probe() | expand

Commit Message

Markus Elfring Sept. 21, 2019, 5:02 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 21 Sep 2019 18:56:54 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/edac/bluefield_edac.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--
2.23.0
diff mbox series

Patch

diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c
index e4736eb37bfb..0d09add30460 100644
--- a/drivers/edac/bluefield_edac.c
+++ b/drivers/edac/bluefield_edac.c
@@ -245,7 +245,6 @@  static int bluefield_edac_mc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct edac_mc_layer layers[1];
 	struct mem_ctl_info *mci;
-	struct resource *emi_res;
 	unsigned int mc_idx, dimm_count;
 	int rc, ret;

@@ -266,10 +265,6 @@  static int bluefield_edac_mc_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}

-	emi_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!emi_res)
-		return -EINVAL;
-
 	layers[0].type = EDAC_MC_LAYER_SLOT;
 	layers[0].size = dimm_count;
 	layers[0].is_virt_csrow = true;
@@ -281,7 +276,7 @@  static int bluefield_edac_mc_probe(struct platform_device *pdev)
 	priv = mci->pvt_info;

 	priv->dimm_per_mc = dimm_count;
-	priv->emi_base = devm_ioremap_resource(dev, emi_res);
+	priv->emi_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->emi_base)) {
 		dev_err(dev, "failed to map EMI IO resource\n");
 		ret = PTR_ERR(priv->emi_base);