[PATCH v2] spi: aspeed: Use devm_iounmap() to unmap devm_ioremap() memory
From: Chin-Ting Kuo
Date: Thu Nov 06 2025 - 04:19:10 EST
Use devm_iounmap() to unmap memory mapped with devm_ioremap().
Thus ensure proper cleanup of device-managed resources.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202510292356.JnTUBxCl-lkp@xxxxxxxxx/
Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@xxxxxxxxxxxxxx>
Reviewed-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
Reviewed-by: Cédric Le Goater <clg@xxxxxxxxxx>
---
V2: Refine commit message for clarity.
drivers/spi/spi-aspeed-smc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
index e8bd8fe6c4e7..179c47ffbfeb 100644
--- a/drivers/spi/spi-aspeed-smc.c
+++ b/drivers/spi/spi-aspeed-smc.c
@@ -396,7 +396,7 @@ static int aspeed_spi_set_window(struct aspeed_spi *aspi)
for (cs = 0; cs < aspi->data->max_cs; cs++) {
if (aspi->chips[cs].ahb_base) {
- iounmap(aspi->chips[cs].ahb_base);
+ devm_iounmap(dev, aspi->chips[cs].ahb_base);
aspi->chips[cs].ahb_base = NULL;
}
}
--
2.34.1