i2c: core: Dispose OF IRQ mapping at client removal time
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 30 Oct 2014 13:59:37 +0000 (15:59 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 7 Nov 2014 18:03:18 +0000 (19:03 +0100)
Clients instantiated from OF get an IRQ mapping created at device
registration time. Dispose the mapping when the client is removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/i2c-core.c

index 17a1853c6c2f313f02d9a4114027171b2eb09db7..f43b4e11647a28338235b1fcba1070ab2a34f91b 100644 (file)
@@ -665,6 +665,9 @@ static int i2c_device_remove(struct device *dev)
                status = driver->remove(client);
        }
 
+       if (dev->of_node)
+               irq_dispose_mapping(client->irq);
+
        dev_pm_domain_detach(&client->dev, true);
        return status;
 }