Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <kw-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
To: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Jingoo Han <jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Krzysztof Kozlowski
	<krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Richard Zhu <hongxing.zhu-3arQi8VN3Tc@public.gmane.org>,
	Lucas Stach <l.stach-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>,
	Yue Wang <yue.wang-jh/zon5tOX5BDgjK7y7TUQ@public.gmane.org>,
	Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	Jesper Nilsson <jesper.nilsson-VrBV9hrLPhE@public.gmane.org>,
	Xiaowei Song
	<songxiaowei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>,
	Binghui Wang
	<wangbinghui-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>,
	Pratyush Anand
	<pratyush.anand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hou Zhiqiang <Zhiqiang.Hou-3arQi8VN3Tc@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Toan Le <toan-shex6MNQR2J/SfDzf78azzKzEDxYleXD@public.gmane.org>,
	Ley Foon Tan
	<ley.foon.tan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>Shawn Lin
	<shawn>
Subject: [PATCH 10/10] PCI: xilinx-nwl: Remove dev_err() when handing an error from platform_get_irq()
Date: Mon,  3 Aug 2020 07:10:40 +0000	[thread overview]
Message-ID: <20200803071040.1663662-1-kw@linux.com> (raw)
In-Reply-To: <20200802142601.1635926-1-kw-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>

There is no need to call the dev_err() function directly to print a
custom message when handling an error from either the platform_get_irq()
or platform_get_irq_byname() functions as both are going to display an
appropriate error message in case of a failure.

This change is as per suggestion from Coccinelle:

  drivers/pci/controller/pcie-xilinx-nwl.c:732:2-9: line 732 is
  redundant because platform_get_irq() already prints an error

  drivers/pci/controller/pcie-xilinx-nwl.c:589:2-9: line 589 is
  redundant because platform_get_irq() already prints an error

  drivers/pci/controller/pcie-xilinx-nwl.c:600:2-9: line 600 is
  redundant because platform_get_irq() already prints an error

  drivers/pci/controller/pcie-xilinx-nwl.c:801:2-9: line 801 is
  redundant because platform_get_irq() already prints an error

Suggested-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Krzysztof Wilczyński <kw-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
---
 drivers/pci/controller/pcie-xilinx-nwl.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c
index 9bd1427f2fd6..55489b728484 100644
--- a/drivers/pci/controller/pcie-xilinx-nwl.c
+++ b/drivers/pci/controller/pcie-xilinx-nwl.c
@@ -586,7 +586,6 @@ static int nwl_pcie_enable_msi(struct nwl_pcie *pcie)
 	/* Get msi_1 IRQ number */
 	msi->irq_msi1 = platform_get_irq_byname(pdev, "msi1");
 	if (msi->irq_msi1 < 0) {
-		dev_err(dev, "failed to get IRQ#%d\n", msi->irq_msi1);
 		ret = -EINVAL;
 		goto err;
 	}
@@ -597,7 +596,6 @@ static int nwl_pcie_enable_msi(struct nwl_pcie *pcie)
 	/* Get msi_0 IRQ number */
 	msi->irq_msi0 = platform_get_irq_byname(pdev, "msi0");
 	if (msi->irq_msi0 < 0) {
-		dev_err(dev, "failed to get IRQ#%d\n", msi->irq_msi0);
 		ret = -EINVAL;
 		goto err;
 	}
@@ -728,11 +726,8 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie)
 
 	/* Get misc IRQ number */
 	pcie->irq_misc = platform_get_irq_byname(pdev, "misc");
-	if (pcie->irq_misc < 0) {
-		dev_err(dev, "failed to get misc IRQ %d\n",
-			pcie->irq_misc);
+	if (pcie->irq_misc < 0)
 		return -EINVAL;
-	}
 
 	err = devm_request_irq(dev, pcie->irq_misc,
 			       nwl_pcie_misc_handler, IRQF_SHARED,
@@ -797,10 +792,8 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie,
 
 	/* Get intx IRQ number */
 	pcie->irq_intx = platform_get_irq_byname(pdev, "intx");
-	if (pcie->irq_intx < 0) {
-		dev_err(dev, "failed to get intx IRQ %d\n", pcie->irq_intx);
+	if (pcie->irq_intx < 0)
 		return pcie->irq_intx;
-	}
 
 	irq_set_chained_handler_and_data(pcie->irq_intx,
 					 nwl_pcie_leg_handler, pcie);
-- 
2.27.0

      parent reply	other threads:[~2020-08-03  7:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 14:25 [PATCH 00/10] Remove surplus dev_err() when handing an error from platform_get_irq() Krzysztof Wilczyński
2020-08-02 14:25 ` [PATCH 01/10] PCI: dwc: Remove " Krzysztof Wilczyński
     [not found]   ` <20200802142601.1635926-2-kw-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2020-08-03  7:16     ` Jesper Nilsson
2020-08-02 14:25 ` [PATCH 02/10] PCI: mobiveil: " Krzysztof Wilczyński
2020-08-02 14:25 ` [PATCH 04/10] PCI: altera: " Krzysztof Wilczyński
2020-08-03  6:19   ` Tan, Ley Foon
2020-08-02 14:25 ` [PATCH 05/10] PCI: host-generic: " Krzysztof Wilczyński
2020-08-02 14:25 ` [PATCH 07/10] PCI: altera-msi: " Krzysztof Wilczyński
     [not found] ` <20200802142601.1635926-1-kw-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2020-08-02 14:25   ` [PATCH 03/10] PCI: tegra: " Krzysztof Wilczyński
2020-08-02 14:25   ` [PATCH 06/10] PCI: v3-semi: " Krzysztof Wilczyński
2020-08-02 14:26   ` [PATCH 08/10] PCI: xgene-msi: " Krzysztof Wilczyński
2020-08-02 14:26   ` [PATCH 09/10] PCI: rockchip: " Krzysztof Wilczyński
2020-08-03  2:01   ` [PATCH 00/10] Remove surplus " Bjorn Helgaas
2020-08-03 11:10     ` Krzysztof Wilczyński
2020-08-03 14:55     ` Bjorn Helgaas
2020-08-03  7:10   ` Krzysztof Wilczyński [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200803071040.1663662-1-kw@linux.com \
    --to=kw-vytec60ixjuavxtiumwx3w@public.gmane.org \
    --cc=Zhiqiang.Hou-3arQi8VN3Tc@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=hongxing.zhu-3arQi8VN3Tc@public.gmane.org \
    --cc=jesper.nilsson-VrBV9hrLPhE@public.gmane.org \
    --cc=jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=l.stach-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=ley.foon.tan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=m-karicheri2-l0cyMroinI0@public.gmane.org \
    --cc=pratyush.anand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=songxiaowei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=thomas.petazzoni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
    --cc=toan-shex6MNQR2J/SfDzf78azzKzEDxYleXD@public.gmane.org \
    --cc=wangbinghui-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
    --cc=yue.wang-jh/zon5tOX5BDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox