Skip to contentSkip to conversation

PCI: al: Remove redundant dev_err call in al_pcie_probe()

PATCH RESEND In review ChenXiaoSong 2 participants 2 messages Jun 8, 2021 – Nov 3, 2021

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

PATCH RESEND 1/1 PCI: al: Remove redundant dev_err call in al_pcie_probe()

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

---
 drivers/pci/controller/dwc/pcie-al.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-al.c +1 -4
index e8afa50129a8..fb4d1eed07ce 100644
@@ -346,11 +346,8 @@ static int al_pcie_probe(struct platform_device *pdev)
 	controller_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 						      "controller");
 	al_pcie->controller_base = devm_ioremap_resource(dev, controller_res);
-	if (IS_ERR(al_pcie->controller_base)) {
-		dev_err(dev, "couldn't remap controller base %pR\n",
-			controller_res);
+	if (IS_ERR(al_pcie->controller_base))
 		return PTR_ERR(al_pcie->controller_base);
-	}
 
 	dev_dbg(dev, "From DT: controller_base: %pR\n", controller_res);
 
Signature · 1 line
2.25.4
#1 lore raw

[+cc Krzysztof]

If this was a resend, the original got lost:
https://lore.kernel.org/linux-pci/?q=s%3A%22redundant+dev_err+call+in+al_pcie_probe%22

Quoted 15 lines · ChenXiaoSong

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

---
 drivers/pci/controller/dwc/pcie-al.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-al.c +0 -0
index e8afa50129a8..fb4d1eed07ce 100644

drivers/pci/controller/dwc/pcie-al.c static int al_pcie_probe(struct platform_device *pdev) · line 353

Quoted 9 lines
drivers/pci/controller/dwc/pcie-al.c +1 -4
@@ -346,11 +346,8 @@ static int al_pcie_probe(struct platform_device *pdev)
 	controller_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 						      "controller");
 	al_pcie->controller_base = devm_ioremap_resource(dev, controller_res);
-	if (IS_ERR(al_pcie->controller_base)) {
-		dev_err(dev, "couldn't remap controller base %pR\n",
-			controller_res);
+	if (IS_ERR(al_pcie->controller_base))
 		return PTR_ERR(al_pcie->controller_base);
-	}

This is OK, but I think we could use devm_platform_ioremap_resource() instead and simplify even a little more.

There are several other drivers that could use devm_platform_ioremap_resource(), devm_platform_ioremap_resource_byname(), or devm_platform_get_and_ioremap_resource() for slight simplification.

Quoted 5 lines
drivers/pci/controller/dwc/pcie-al.c +0 -0
 	dev_dbg(dev, "From DT: controller_base: %pR\n", controller_res);
 
Signature · 1 line
2.25.4