Linux-Amlogic Archive on lore.kernel.org
 help / color / Atom feed
From: "Krzysztof Wilczyński" <kw@linux.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Heiko Stuebner <heiko@sntech.de>,
	linux-pci@vger.kernel.org, Shawn Lin <shawn.lin@rock-chips.com>,
	Binghui Wang <wangbinghui@hisilicon.com>,
	linux-arm-kernel@axis.com, Ley Foon Tan <ley.foon.tan@intel.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Toan Le <toan@os.amperecomputing.com>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	linux-samsung-soc@vger.kernel.org,
	Kevin Hilman <khilman@baylibre.com>,
	Pratyush Anand <pratyush.anand@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-rockchip@lists.infradead.org, Kukjin Kim <kgene@kernel.org>,
	Xiaowei Song <songxiaowei@hisilicon.com>,
	Hou Zhiqiang <Zhiqiang.Hou@nxp.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Richard Zhu <hongxing.zhu@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Yue Wang <yue.wang@Amlogic.com>,
	Murali Karicheri <m-karicheri2@ti.com>,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Jingoo Han <jingoohan1@gmail.com>,
	rfi@lists.rocketboards.org, Shawn Guo <shawnguo@kernel.org>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: [PATCH 02/10] PCI: mobiveil: Remove dev_err() when handing an error from platform_get_irq()
Date: Sun,  2 Aug 2020 14:25:54 +0000
Message-ID: <20200802142601.1635926-3-kw@linux.com> (raw)
In-Reply-To: <20200802142601.1635926-1-kw@linux.com>

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/mobiveil/pcie-layerscape-gen4.c:174:2-9: line
  174 is redundant because platform_get_irq() already prints an error

  drivers/pci/controller/mobiveil/pcie-mobiveil-host.c:526:2-9: line 526
  is redundant because platform_get_irq() already prints an error

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c | 5 ++---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c   | 4 +---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
index a6d2190a6753..ee0156921ebc 100644
--- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
+++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
@@ -170,10 +170,9 @@ static int ls_pcie_g4_interrupt_init(struct mobiveil_pcie *mv_pci)
 	int ret;
 
 	pcie->irq = platform_get_irq_byname(pdev, "intr");
-	if (pcie->irq < 0) {
-		dev_err(dev, "Can't get 'intr' IRQ, errno = %d\n", pcie->irq);
+	if (pcie->irq < 0)
 		return pcie->irq;
-	}
+
 	ret = devm_request_irq(dev, pcie->irq, ls_pcie_g4_isr,
 			       IRQF_SHARED, pdev->name, pcie);
 	if (ret) {
diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
index 5907baa9b1f2..fa321fcdd4bc 100644
--- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
+++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
@@ -522,10 +522,8 @@ static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie)
 	mobiveil_pcie_enable_msi(pcie);
 
 	rp->irq = platform_get_irq(pdev, 0);
-	if (rp->irq < 0) {
-		dev_err(dev, "failed to map IRQ: %d\n", rp->irq);
+	if (rp->irq < 0)
 		return rp->irq;
-	}
 
 	/* initialize the IRQ domains */
 	ret = mobiveil_pcie_init_irq_domain(pcie);
-- 
2.27.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 14:25 [PATCH 00/10] Remove surplus " Krzysztof Wilczyński
2020-08-02 14:25 ` [PATCH 01/10] PCI: dwc: Remove " Krzysztof Wilczyński
2020-08-03  7:16   ` Jesper Nilsson
2020-08-02 14:25 ` Krzysztof Wilczyński [this message]
2020-08-02 14:25 ` [PATCH 03/10] PCI: tegra: " 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 06/10] PCI: v3-semi: " Krzysztof Wilczyński
2020-08-02 14:25 ` [PATCH 07/10] PCI: altera-msi: " 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 ` [PATCH 10/10] PCI: xilinx-nwl: Remove " Krzysztof Wilczyński

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=20200802142601.1635926-3-kw@linux.com \
    --to=kw@linux.com \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=heiko@sntech.de \
    --cc=hongxing.zhu@nxp.com \
    --cc=jesper.nilsson@axis.com \
    --cc=jingoohan1@gmail.com \
    --cc=kgene@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=l.stach@pengutronix.de \
    --cc=ley.foon.tan@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@axis.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=pratyush.anand@gmail.com \
    --cc=rfi@lists.rocketboards.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.lin@rock-chips.com \
    --cc=shawnguo@kernel.org \
    --cc=songxiaowei@hisilicon.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=toan@os.amperecomputing.com \
    --cc=wangbinghui@hisilicon.com \
    --cc=yue.wang@Amlogic.com \
    /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

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org
	public-inbox-index linux-amlogic

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git