[PATCH 2/3] dma: mv_xor: add missing platform remove function
From: Rosen Penev
Date: Wed Jun 10 2026 - 02:58:06 EST
The driver was missing a remove callback, so channels, DMA
devices, and IRQs were never cleaned up on driver unbind.
Implement mv_xor_remove to undo probe, patterned after the
existing error path.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/dma/mv_xor.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index a97fa0038652..3fc39cca7cbd 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1452,8 +1452,22 @@ static int mv_xor_probe(struct platform_device *pdev)
return ret;
}
+static void mv_xor_remove(struct platform_device *pdev)
+{
+ struct mv_xor_device *xordev = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
+ if (xordev->channels[i]) {
+ mv_xor_channel_remove(xordev->channels[i]);
+ if (pdev->dev.of_node)
+ irq_dispose_mapping(xordev->channels[i]->irq);
+ }
+}
+
static struct platform_driver mv_xor_driver = {
.probe = mv_xor_probe,
+ .remove = mv_xor_remove,
.suspend = mv_xor_suspend,
.resume = mv_xor_resume,
.driver = {
--
2.54.0