From: phucduc.bui@gmail.com
To: Ulf Hansson <ulfh@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Jisheng Zhang <jszhang@kernel.org>,
Stepan Ionichev <sozdayvek@gmail.com>,
Colin Ian King <colin.i.king@gmail.com>,
Pedro Demarchi Gomes <pedrodemargomes@gmail.com>,
Osama Abdelkader <osama.abdelkader@gmail.com>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2 3/3] mmc: davinci: Handle optional IRQ return value correctly
Date: Thu, 13 Aug 2026 12:34:04 +0700 [thread overview]
Message-ID: <20260813053404.21553-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260813053404.21553-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
host->sdio_irq is assigned from platform_get_irq_optional(), which
returns a positive IRQ number on success or a negative error code on
failure. Therefore, 0 is not a possible return value from this API.
Check for a positive IRQ number before requesting the SDIO IRQ instead
of treating zero as a valid IRQ.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/mmc/host/davinci_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 773577a10512..c503e5f5c886 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1303,7 +1303,7 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
if (ret)
goto mmc_add_host_fail;
- if (host->sdio_irq >= 0) {
+ if (host->sdio_irq > 0) {
ret = devm_request_irq(&pdev->dev, host->sdio_irq,
mmc_davinci_sdio_irq, 0,
mmc_hostname(mmc), host);
--
2.43.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: phucduc.bui@gmail.com
To: Ulf Hansson <ulfh@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Jisheng Zhang <jszhang@kernel.org>,
Stepan Ionichev <sozdayvek@gmail.com>,
Colin Ian King <colin.i.king@gmail.com>,
Pedro Demarchi Gomes <pedrodemargomes@gmail.com>,
Osama Abdelkader <osama.abdelkader@gmail.com>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2 3/3] mmc: davinci: Handle optional IRQ return value correctly
Date: Thu, 13 Aug 2026 12:34:04 +0700 [thread overview]
Message-ID: <20260813053404.21553-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260813053404.21553-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
host->sdio_irq is assigned from platform_get_irq_optional(), which
returns a positive IRQ number on success or a negative error code on
failure. Therefore, 0 is not a possible return value from this API.
Check for a positive IRQ number before requesting the SDIO IRQ instead
of treating zero as a valid IRQ.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/mmc/host/davinci_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 773577a10512..c503e5f5c886 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1303,7 +1303,7 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
if (ret)
goto mmc_add_host_fail;
- if (host->sdio_irq >= 0) {
+ if (host->sdio_irq > 0) {
ret = devm_request_irq(&pdev->dev, host->sdio_irq,
mmc_davinci_sdio_irq, 0,
mmc_hostname(mmc), host);
--
2.43.0
next prev parent reply other threads:[~2026-08-13 5:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 5:34 [PATCH v2 0/3] mmc: Handle errors from optional IRQ lookup phucduc.bui
2026-08-13 5:34 ` phucduc.bui
2026-08-13 5:34 ` [PATCH v2 1/3] mmc: meson-gx: " phucduc.bui
2026-08-13 5:34 ` phucduc.bui
2026-08-13 5:34 ` [PATCH v2 2/3] mmc: davinci: " phucduc.bui
2026-08-13 5:34 ` phucduc.bui
2026-08-13 5:34 ` phucduc.bui [this message]
2026-08-13 5:34 ` [PATCH v2 3/3] mmc: davinci: Handle optional IRQ return value correctly phucduc.bui
2026-08-13 5:45 ` sashiko-bot
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=20260813053404.21553-4-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=colin.i.king@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=jszhang@kernel.org \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=osama.abdelkader@gmail.com \
--cc=pedrodemargomes@gmail.com \
--cc=sozdayvek@gmail.com \
--cc=ulfh@kernel.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 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.