* [PATCHv2] ata: pata_pxa: use devres for DMA channel management
@ 2026-07-21 1:58 Rosen Penev
2026-07-23 7:38 ` Damien Le Moal
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-07-21 1:58 UTC (permalink / raw)
To: linux-ide
Cc: Damien Le Moal, Niklas Cassel, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, open list,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
Convert the DMA channel request to devm_dma_request_chan() so the
channel is released automatically on device teardown. This removes
the explicit dma_release_channel() calls in the probe error paths
and in pxa_ata_remove(), simplifying the driver.
Use ata_platform_remove_one() which is now equivalent to what remains of
the remove function after dma_release_channel() removal.
Built as a module for arm/pxa_defconfig (CONFIG_PATA_PXA=m) with
LLVM=1 W=1; no new warnings.
Assisted-by: opencode:hy3-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2: Use ata_platform_remove_one()
drivers/ata/pata_pxa.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
index c816997dc0a9..a694f6a178e3 100644
--- a/drivers/ata/pata_pxa.c
+++ b/drivers/ata/pata_pxa.c
@@ -262,40 +262,26 @@ static int pxa_ata_probe(struct platform_device *pdev)
/*
* Request the DMA channel
*/
- data->dma_chan = dma_request_chan(&pdev->dev, "data");
+ data->dma_chan = devm_dma_request_chan(&pdev->dev, "data");
if (IS_ERR(data->dma_chan))
return PTR_ERR(data->dma_chan);
+
ret = dmaengine_slave_config(data->dma_chan, &config);
if (ret < 0) {
dev_err(&pdev->dev, "dma configuration failed: %d\n", ret);
- dma_release_channel(data->dma_chan);
return ret;
}
/*
* Activate the ATA host
*/
- ret = ata_host_activate(host, irq, ata_sff_interrupt,
+ return ata_host_activate(host, irq, ata_sff_interrupt,
pdata->irq_flags, &pxa_ata_sht);
- if (ret)
- dma_release_channel(data->dma_chan);
-
- return ret;
-}
-
-static void pxa_ata_remove(struct platform_device *pdev)
-{
- struct ata_host *host = platform_get_drvdata(pdev);
- struct pata_pxa_data *data = host->ports[0]->private_data;
-
- dma_release_channel(data->dma_chan);
-
- ata_host_detach(host);
}
static struct platform_driver pxa_ata_driver = {
.probe = pxa_ata_probe,
- .remove = pxa_ata_remove,
+ .remove = ata_platform_remove_one,
.driver = {
.name = DRV_NAME,
},
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCHv2] ata: pata_pxa: use devres for DMA channel management
2026-07-21 1:58 [PATCHv2] ata: pata_pxa: use devres for DMA channel management Rosen Penev
@ 2026-07-23 7:38 ` Damien Le Moal
0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2026-07-23 7:38 UTC (permalink / raw)
To: Rosen Penev, linux-ide
Cc: Niklas Cassel, Nathan Chancellor, Nick Desaulniers, Bill Wendling,
Justin Stitt, open list,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
On 7/21/26 10:58, Rosen Penev wrote:
> Convert the DMA channel request to devm_dma_request_chan() so the
> channel is released automatically on device teardown. This removes
> the explicit dma_release_channel() calls in the probe error paths
> and in pxa_ata_remove(), simplifying the driver.
>
> Use ata_platform_remove_one() which is now equivalent to what remains of
> the remove function after dma_release_channel() removal.
>
> Built as a module for arm/pxa_defconfig (CONFIG_PATA_PXA=m) with
> LLVM=1 W=1; no new warnings.
>
> Assisted-by: opencode:hy3-free
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Applied to for-7.3. Thanks!
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-23 7:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 1:58 [PATCHv2] ata: pata_pxa: use devres for DMA channel management Rosen Penev
2026-07-23 7:38 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox