Skip to contentSkip to conversation

mtd: aspeed: remove redundant dev_err call in aspeed_smc_probe()

PATCH In review Wei Yongjun 3 participants 3 messages Feb 8, 2017 – Feb 10, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: aspeed: remove redundant dev_err call in aspeed_smc_probe()

From: Wei Yongjun <[email protected]>

There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message.

---
 drivers/mtd/spi-nor/aspeed-smc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/spi-nor/aspeed-smc.c +2 -6
index 7c86099..56051d3 100644
@@ -723,17 +723,13 @@ static int aspeed_smc_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	controller->regs = devm_ioremap_resource(dev, res);
-	if (IS_ERR(controller->regs)) {
-		dev_err(dev, "Cannot remap controller address.\n");
+	if (IS_ERR(controller->regs))
 		return PTR_ERR(controller->regs);
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	controller->ahb_base = devm_ioremap_resource(dev, res);
-	if (IS_ERR(controller->ahb_base)) {
-		dev_err(dev, "Cannot remap controller address.\n");
+	if (IS_ERR(controller->ahb_base))
 		return PTR_ERR(controller->ahb_base);
-	}
 
 	ret = aspeed_smc_setup_flash(controller, np, res);
 	if (ret)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message.

Quoted 31 lines
---
 drivers/mtd/spi-nor/aspeed-smc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mtd/spi-nor/aspeed-smc.c +2 -6
index 7c86099..56051d3 100644
@@ -723,17 +723,13 @@ static int aspeed_smc_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	controller->regs = devm_ioremap_resource(dev, res);
-	if (IS_ERR(controller->regs)) {
-		dev_err(dev, "Cannot remap controller address.\n");
+	if (IS_ERR(controller->regs))
 		return PTR_ERR(controller->regs);
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	controller->ahb_base = devm_ioremap_resource(dev, res);
-	if (IS_ERR(controller->ahb_base)) {
-		dev_err(dev, "Cannot remap controller address.\n");
+	if (IS_ERR(controller->ahb_base))
 		return PTR_ERR(controller->ahb_base);
-	}
 
 	ret = aspeed_smc_setup_flash(controller, np, res);
 	if (ret)
Signature · 2 lines
Best regards,
Marek Vasut