From 2f538ef9f6f7c3d700c68536f21447dfc598f8c8 Mon Sep 17 00:00:00 2001 From: Chin-Ting Kuo Date: Wed, 5 Nov 2025 16:49:52 +0800 Subject: [PATCH] spi: aspeed: Use devm_iounmap() to unmap devm_ioremap() memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The AHB IO memory for each chip select is mapped using devm_ioremap(), so it should be unmapped using devm_iounmap() to ensure proper device-managed resource cleanup. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202510292356.JnTUBxCl-lkp@intel.com/ Signed-off-by: Chin-Ting Kuo Reviewed-by: Cédric Le Goater Link: https://patch.msgid.link/20251105084952.1063489-1-chin-ting_kuo@aspeedtech.com Signed-off-by: Mark Brown --- 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 e8bd8fe6c4e77..179c47ffbfeb1 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.47.3