From: Rosen Penev <rosenp@gmail.com>
To: linux-crypto@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] crypto: talitos: Use platform_get_irq() to retrieve interrupt
Date: Sun, 26 Jul 2026 17:53:44 -0700 [thread overview]
Message-ID: <20260727005344.166124-1-rosenp@gmail.com> (raw)
Remove the need to call irq_dispose_mapping as needed by
irq_of_parse_and_map().
Simplify the function as a result. No need for gotos anymore.
Add a missing free_irq.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/crypto/talitos.c | 43 +++++++++++++---------------------------
1 file changed, 14 insertions(+), 29 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 3a3fd21d2c4d..bff653b87941 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -3241,10 +3241,8 @@ static void talitos_remove(struct platform_device *ofdev)
talitos_unregister_rng(dev);
for (i = 0; i < 2; i++)
- if (priv->irq[i]) {
+ if (priv->irq[i])
free_irq(priv->irq[i], dev);
- irq_dispose_mapping(priv->irq[i]);
- }
tasklet_kill(&priv->done_task[0]);
if (priv->irq[1])
@@ -3353,54 +3351,41 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
static int talitos_probe_irq(struct platform_device *ofdev)
{
struct device *dev = &ofdev->dev;
- struct device_node *np = ofdev->dev.of_node;
struct talitos_private *priv = dev_get_drvdata(dev);
int err;
bool is_sec1 = has_ftr_sec1(priv);
- priv->irq[0] = irq_of_parse_and_map(np, 0);
- if (!priv->irq[0]) {
- dev_err(dev, "failed to map irq\n");
- return -EINVAL;
- }
- if (is_sec1) {
- err = request_irq(priv->irq[0], talitos1_interrupt_4ch, 0,
+ priv->irq[0] = platform_get_irq(ofdev, 0);
+ if (priv->irq[0] < 0)
+ return priv->irq[0];
+
+ if (is_sec1)
+ return request_irq(priv->irq[0], talitos1_interrupt_4ch, 0,
dev_driver_string(dev), dev);
- goto primary_out;
- }
- priv->irq[1] = irq_of_parse_and_map(np, 1);
+ priv->irq[1] = platform_get_irq_optional(ofdev, 1);
+ if (priv->irq[1] == -EPROBE_DEFER)
+ return priv->irq[1];
/* get the primary irq line */
- if (!priv->irq[1]) {
- err = request_irq(priv->irq[0], talitos2_interrupt_4ch, 0,
+ if (priv->irq[1] < 0)
+ return request_irq(priv->irq[0], talitos2_interrupt_4ch, 0,
dev_driver_string(dev), dev);
- goto primary_out;
- }
err = request_irq(priv->irq[0], talitos2_interrupt_ch0_2, 0,
dev_driver_string(dev), dev);
if (err)
- goto primary_out;
+ return err;
/* get the secondary irq line */
err = request_irq(priv->irq[1], talitos2_interrupt_ch1_3, 0,
dev_driver_string(dev), dev);
if (err) {
dev_err(dev, "failed to request secondary irq\n");
- irq_dispose_mapping(priv->irq[1]);
+ free_irq(priv->irq[0], dev);
priv->irq[1] = 0;
}
- return err;
-
-primary_out:
- if (err) {
- dev_err(dev, "failed to request primary irq\n");
- irq_dispose_mapping(priv->irq[0]);
- priv->irq[0] = 0;
- }
-
return err;
}
--
2.55.0
reply other threads:[~2026-07-27 0:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260727005344.166124-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®