thermal/drivers/spacemit/k1: Add shutdown action and reorder registration order

Add a devm action to clean hardware interrupts, sampling, and control
registers on driver unbind, mirroring what k1_tsensor_init() sets up.

Reorder the registration order within probe(): register the thermal
zones first, then request the IRQ, and register the shutdown action
last.  On removal, the hardware interrupt is disabled first, then the
IRQ is released, and finally the thermal zones are released.  This
avoids the IRQ thread accessing an already unregistered thermal zone
during devres cleanup.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Link: https://patch.msgid.link/1967d2bcc8fede6fbd25fc8eee07f2873fb41472.1784184867.git.xiaopei01@kylinos.cn
This commit is contained in:
Pei Xiao 2026-07-16 15:04:19 +08:00 • committed by Daniel Lezcano
commit 9cbf780428
No known key found for this signature in database
GPG key ID: A832238A2A4FE84F