linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next,resend] PCI: al: Remove redundant dev_err call in al_pcie_probe()
@ 2021-06-08  8:49 ChenXiaoSong
  2021-11-03 18:34 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: ChenXiaoSong @ 2021-06-08  8:49 UTC (permalink / raw)
  To: jonnyc, lorenzo.pieralisi, bhelgaas
  Cc: linux-pci, linux-kernel, yukuai3, yi.zhang, chenxiaosong2

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

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com>
---
 drivers/pci/controller/dwc/pcie-al.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-al.c b/drivers/pci/controller/dwc/pcie-al.c
index e8afa50129a8..fb4d1eed07ce 100644
--- a/drivers/pci/controller/dwc/pcie-al.c
+++ b/drivers/pci/controller/dwc/pcie-al.c
@@ -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);
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next,resend] PCI: al: Remove redundant dev_err call in al_pcie_probe()
  2021-06-08  8:49 [PATCH -next,resend] PCI: al: Remove redundant dev_err call in al_pcie_probe() ChenXiaoSong
@ 2021-11-03 18:34 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2021-11-03 18:34 UTC (permalink / raw)
  To: ChenXiaoSong
  Cc: jonnyc, lorenzo.pieralisi, bhelgaas, linux-pci, linux-kernel,
	yukuai3, yi.zhang, Krzysztof Wilczyński

[+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

On Tue, Jun 08, 2021 at 04:49:13PM +0800, ChenXiaoSong wrote:
> There is a error message within devm_ioremap_resource
> already, so remove the dev_err call to avoid redundant
> error message.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com>
> ---
>  drivers/pci/controller/dwc/pcie-al.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-al.c b/drivers/pci/controller/dwc/pcie-al.c
> index e8afa50129a8..fb4d1eed07ce 100644
> --- a/drivers/pci/controller/dwc/pcie-al.c
> +++ b/drivers/pci/controller/dwc/pcie-al.c
> @@ -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.

>  	dev_dbg(dev, "From DT: controller_base: %pR\n", controller_res);
>  
> -- 
> 2.25.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-03 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08  8:49 [PATCH -next,resend] PCI: al: Remove redundant dev_err call in al_pcie_probe() ChenXiaoSong
2021-11-03 18:34 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).