From d35218e410b3c54f652ccc13b31f9e2247248cc8 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sun, 9 Jul 2017 08:09:59 +0100 Subject: [PATCH] platform_device cleanup iomap --- kernel_module/platform_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel_module/platform_device.c b/kernel_module/platform_device.c index a0f6192..0776b80 100644 --- a/kernel_module/platform_device.c +++ b/kernel_module/platform_device.c @@ -29,6 +29,8 @@ static void __iomem *map; static irqreturn_t lkmc_irq_handler(int irq, void *dev) { + /* TODO this 34 and not 18 as in the DTS, likely the interrupt controller moves it around. + * Understand precisely. 34 = 18 + 16. */ pr_info("lkmc_irq_handler irq = %d dev = %llx\n", irq, *(unsigned long long *)dev); /* ACK the IRQ. */ iowrite32(0x9ABCDEF0, map + 4); @@ -88,7 +90,7 @@ static int lkmc_platform_device_remove(struct platform_device *pdev) { dev_info(&pdev->dev, "remove\n"); free_irq(irq, &pdev->dev); - /* TODO free iomap. */ + iounmap(map); release_mem_region(res.start, resource_size(&res)); return 0; }