From: Ricardo Ribalda <ribalda@chromium.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>
Cc: linux-media@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
Ricardo Ribalda <ribalda@chromium.org>
Subject: [PATCH v2 1/2] media: bcm2835-unicam: Do not replace IRQ retcode during probe
Date: Mon, 06 May 2024 19:24:46 +0000 [thread overview]
Message-ID: <20240506-fix-broad-v2-1-e6a2a5c0d609@chromium.org> (raw)
In-Reply-To: <20240506-fix-broad-v2-0-e6a2a5c0d609@chromium.org>
platform_get_irq() cannot return the value 0. It will either return a non-zero
irq or a errcode.
If a errcode is returned, we need to populate the error code upwards. It will
give a more accurate reason of why it failed to the caller, who might decide
to retry later.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
drivers/media/platform/broadcom/bcm2835-unicam.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
index bd2bbb53070e..60c0fe956c58 100644
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -2660,9 +2660,8 @@ static int unicam_probe(struct platform_device *pdev)
}
ret = platform_get_irq(pdev, 0);
- if (ret <= 0) {
+ if (ret < 0) {
dev_err(&pdev->dev, "No IRQ resource\n");
- ret = -EINVAL;
goto err_unicam_put;
}
@@ -2670,7 +2669,6 @@ static int unicam_probe(struct platform_device *pdev)
"unicam_capture0", unicam);
if (ret) {
dev_err(&pdev->dev, "Unable to request interrupt\n");
- ret = -EINVAL;
goto err_unicam_put;
}
--
2.45.0.rc1.225.g2a3ae87e7f-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-06 19:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 19:24 [PATCH v2 0/2] media: bcm2835-unicam: Improve error handling during probe Ricardo Ribalda
2024-05-06 19:24 ` Ricardo Ribalda [this message]
2024-05-07 6:08 ` [PATCH v2 1/2] media: bcm2835-unicam: Do not replace IRQ retcode " Laurent Pinchart
2024-05-06 19:24 ` [PATCH v2 2/2] media: bcm2835-unicam: Do not print error when irq not found Ricardo Ribalda
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=20240506-fix-broad-v2-1-e6a2a5c0d609@chromium.org \
--to=ribalda@chromium.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.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
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;
as well as URLs for NNTP newsgroup(s).