* [PATCH] spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback
@ 2026-03-22 14:28 Felix Gu
2026-03-30 17:54 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-03-22 14:28 UTC (permalink / raw)
To: Liang Yang, Feng Chen, Xianwei Zhao, Mark Brown
Cc: linux-amlogic, linux-spi, linux-kernel, Felix Gu
aml_sfc_probe() registers the on-host NAND ECC engine, but teardown was
missing from both probe unwind and remove-time cleanup. Add a devm cleanup
action after successful registration so
nand_ecc_unregister_on_host_hw_engine() runs automatically on probe
failures and during device removal.
Fixes: 4670db6f32e9 ("spi: amlogic: add driver for Amlogic SPI Flash Controller")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-amlogic-spifc-a4.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/spi/spi-amlogic-spifc-a4.c b/drivers/spi/spi-amlogic-spifc-a4.c
index 1aabafa36e48..16346f50c7d9 100644
--- a/drivers/spi/spi-amlogic-spifc-a4.c
+++ b/drivers/spi/spi-amlogic-spifc-a4.c
@@ -1066,6 +1066,13 @@ static const struct nand_ecc_engine_ops aml_sfc_ecc_engine_ops = {
.finish_io_req = aml_sfc_ecc_finish_io_req,
};
+static void aml_sfc_unregister_ecc_engine(void *data)
+{
+ struct nand_ecc_engine *eng = data;
+
+ nand_ecc_unregister_on_host_hw_engine(eng);
+}
+
static int aml_sfc_clk_init(struct aml_sfc *sfc)
{
sfc->gate_clk = devm_clk_get_enabled(sfc->dev, "gate");
@@ -1149,6 +1156,11 @@ static int aml_sfc_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(&pdev->dev, ret, "failed to register Aml host ecc engine.\n");
+ ret = devm_add_action_or_reset(dev, aml_sfc_unregister_ecc_engine,
+ &sfc->ecc_eng);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to add ECC unregister action\n");
+
ret = of_property_read_u32(np, "amlogic,rx-adj", &val);
if (!ret)
sfc->rx_adj = val;
---
base-commit: 785f0eb2f85decbe7c1ef9ae922931f0194ffc2e
change-id: 20260322-spifc-a4-d17e9559cb15
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback
2026-03-22 14:28 [PATCH] spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback Felix Gu
@ 2026-03-30 17:54 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-03-30 17:54 UTC (permalink / raw)
To: Liang Yang, Feng Chen, Xianwei Zhao, Felix Gu
Cc: linux-amlogic, linux-spi, linux-kernel
On Sun, 22 Mar 2026 22:28:45 +0800, Felix Gu wrote:
> spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.0
Thanks!
[1/1] spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback
https://git.kernel.org/broonie/spi/c/b0dc7e7c5657
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-30 22:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-22 14:28 [PATCH] spi: amlogic: spifc-a4: unregister ECC engine on probe failure and remove() callback Felix Gu
2026-03-30 17:54 ` Mark Brown
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®