mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 04:24:26 +01:00
platform_device cleanup iomap
This commit is contained in:
@@ -29,6 +29,8 @@ static void __iomem *map;
|
|||||||
|
|
||||||
static irqreturn_t lkmc_irq_handler(int irq, void *dev)
|
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);
|
pr_info("lkmc_irq_handler irq = %d dev = %llx\n", irq, *(unsigned long long *)dev);
|
||||||
/* ACK the IRQ. */
|
/* ACK the IRQ. */
|
||||||
iowrite32(0x9ABCDEF0, map + 4);
|
iowrite32(0x9ABCDEF0, map + 4);
|
||||||
@@ -88,7 +90,7 @@ static int lkmc_platform_device_remove(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
dev_info(&pdev->dev, "remove\n");
|
dev_info(&pdev->dev, "remove\n");
|
||||||
free_irq(irq, &pdev->dev);
|
free_irq(irq, &pdev->dev);
|
||||||
/* TODO free iomap. */
|
iounmap(map);
|
||||||
release_mem_region(res.start, resource_size(&res));
|
release_mem_region(res.start, resource_size(&res));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user