All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Thomas Gleixner <tglx@linutronix.de>, Frank Li <Frank.Li@nxp.com>
Cc: Marc Zyngier <maz@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>, Jon Mason <jdmason@kudzu.us>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] irqchip: imx-mu-msi: fix platform_get_irq() error checking
Date: Fri, 12 Aug 2022 09:23:00 +0300	[thread overview]
Message-ID: <YvXxxGHIf1amGV6p@kili> (raw)

The platform_get_irq() function returns negative error codes on error
so "gic_irq" needs to be signed to handle this correctly.  Also change
the "<= 0" check to "< 0" and preserve the error code as the
documentation for platform_get_irq() shows.

Fixes: 893ae515ff8d ("irqchip: imx mu worked as msi controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/irqchip/irq-imx-mu-msi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-msi.c
index f7193a6c1245..97f3cdab8f58 100644
--- a/drivers/irqchip/irq-imx-mu-msi.c
+++ b/drivers/irqchip/irq-imx-mu-msi.c
@@ -80,7 +80,7 @@ struct imx_mu_msi {
 	struct imx_mu_msir	*msir;
 	u32			irqs_num;
 	unsigned long		used;
-	u32			gic_irq;
+	int			gic_irq;
 	struct clk              *clk;
 	struct device		*pd_a;
 	struct device		*pd_b;
@@ -355,8 +355,8 @@ static int imx_mu_msi_probe(struct platform_device *pdev)
 	msi_data->irqs_num = IMX_MU_CHANS;
 
 	msi_data->gic_irq = platform_get_irq(msi_data->pdev, 0);
-	if (msi_data->gic_irq <= 0)
-		return -ENODEV;
+	if (msi_data->gic_irq < 0)
+		return msi_data->gic_irq;
 
 	platform_set_drvdata(pdev, msi_data);
 
-- 
2.35.1


             reply	other threads:[~2022-08-12  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12  6:23 Dan Carpenter [this message]
2022-08-12 16:01 ` [EXT] [PATCH] irqchip: imx-mu-msi: fix platform_get_irq() error checking Frank Li

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=YvXxxGHIf1amGV6p@kili \
    --to=dan.carpenter@oracle.com \
    --cc=Frank.Li@nxp.com \
    --cc=festevam@gmail.com \
    --cc=jdmason@kudzu.us \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.