Commit 8826e110 authored by Cai Huoqing's avatar Cai Huoqing Committed by Miquel Raynal

mtd: rawnand: mtk_ecc: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210901074153.9233-1-caihuoqing@baidu.com
parent 5da7bb27
...@@ -495,7 +495,6 @@ static int mtk_ecc_probe(struct platform_device *pdev) ...@@ -495,7 +495,6 @@ static int mtk_ecc_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct mtk_ecc *ecc; struct mtk_ecc *ecc;
struct resource *res;
u32 max_eccdata_size; u32 max_eccdata_size;
int irq, ret; int irq, ret;
...@@ -513,8 +512,7 @@ static int mtk_ecc_probe(struct platform_device *pdev) ...@@ -513,8 +512,7 @@ static int mtk_ecc_probe(struct platform_device *pdev)
if (!ecc->eccdata) if (!ecc->eccdata)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ecc->regs = devm_platform_ioremap_resource(pdev, 0);
ecc->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(ecc->regs)) if (IS_ERR(ecc->regs))
return PTR_ERR(ecc->regs); return PTR_ERR(ecc->regs);
......
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