From: Rosen Penev <rosenp@gmail.com>
To: dmaengine@vger.kernel.org
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
linux-arm-kernel@lists.infradead.org (moderated list:MICROCHIP
AT91 DMA DRIVERS), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] dmaengine: at_hdmac: ioremap and get irq early
Date: Wed, 22 Jul 2026 22:06:06 -0700 [thread overview]
Message-ID: <20260723050606.283453-1-rosenp@gmail.com> (raw)
The functions can return -EPROBE_DEFER. Call them before anything else
to avoid doing extra work.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/dma/at_hdmac.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index e5b30a57c477..2f6f5877fc3c 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1943,11 +1943,20 @@ static void at_dma_off(struct at_dma *atdma)
static int __init at_dma_probe(struct platform_device *pdev)
{
struct at_dma *atdma;
+ void __iomem *regs;
int irq;
int err;
int i;
const struct at_dma_platform_data *plat_dat;
+ regs = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
/* setup platform data for each SoC */
dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
dma_cap_set(DMA_INTERLEAVE, at91sam9g45_config.cap_mask);
@@ -1968,13 +1977,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
if (!atdma)
return -ENOMEM;
- atdma->regs = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(atdma->regs))
- return PTR_ERR(atdma->regs);
-
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
+ atdma->regs = regs;
/* discover transaction capabilities */
atdma->dma_device.cap_mask = plat_dat->cap_mask;
--
2.55.0
next reply other threads:[~2026-07-23 5:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 5:06 Rosen Penev [this message]
2026-07-23 5:16 ` [PATCH] dmaengine: at_hdmac: ioremap and get irq early 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=20260723050606.283453-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=vkoul@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