From e3a411a3dfc1d633504aa63efab32b7e00318454 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 28 Dec 2006 21:01:32 -0800 Subject: [SPARC64]: Fix of_iounmap() region release. We need to pass in the resource otherwise we cannot release the region properly. We must know whether it is an I/O or MEM resource. Spotted by Eric Brower. Signed-off-by: David S. Miller --- drivers/serial/sunsab.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/serial/sunsab.c') diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 493d5bbb661..145d6236954 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -1037,7 +1037,8 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up, err = request_irq(up->port.irq, sunsab_interrupt, IRQF_SHARED, "sab", up); if (err) { - of_iounmap(up->port.membase, + of_iounmap(&op->resource[0], + up->port.membase, sizeof(union sab82532_async_regs)); return err; } @@ -1064,7 +1065,8 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * sizeof(union sab82532_async_regs), (inst * 2) + 1); if (err) { - of_iounmap(up[0].port.membase, + of_iounmap(&op->resource[0], + up[0].port.membase, sizeof(union sab82532_async_regs)); free_irq(up[0].port.irq, &up[0]); return err; @@ -1082,10 +1084,13 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * static void __devexit sab_remove_one(struct uart_sunsab_port *up) { + struct of_device *op = to_of_device(up->port.dev); + uart_remove_one_port(&sunsab_reg, &up->port); if (!(up->port.line & 1)) free_irq(up->port.irq, up); - of_iounmap(up->port.membase, + of_iounmap(&op->resource[0], + up->port.membase, sizeof(union sab82532_async_regs)); } -- cgit v1.2.3