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/sunzilog.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/serial/sunzilog.c') diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 75de919a947..244f796dc62 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1379,13 +1379,15 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m if (!keyboard_mouse) { err = uart_add_one_port(&sunzilog_reg, &up[0].port); if (err) { - of_iounmap(rp, sizeof(struct zilog_layout)); + of_iounmap(&op->resource[0], + rp, sizeof(struct zilog_layout)); return err; } err = uart_add_one_port(&sunzilog_reg, &up[1].port); if (err) { uart_remove_one_port(&sunzilog_reg, &up[0].port); - of_iounmap(rp, sizeof(struct zilog_layout)); + of_iounmap(&op->resource[0], + rp, sizeof(struct zilog_layout)); return err; } } else { @@ -1414,18 +1416,18 @@ static void __devexit zs_remove_one(struct uart_sunzilog_port *up) uart_remove_one_port(&sunzilog_reg, &up->port); } -static int __devexit zs_remove(struct of_device *dev) +static int __devexit zs_remove(struct of_device *op) { - struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev); + struct uart_sunzilog_port *up = dev_get_drvdata(&op->dev); struct zilog_layout __iomem *regs; zs_remove_one(&up[0]); zs_remove_one(&up[1]); regs = sunzilog_chip_regs[up[0].port.line / 2]; - of_iounmap(regs, sizeof(struct zilog_layout)); + of_iounmap(&op->resource[0], regs, sizeof(struct zilog_layout)); - dev_set_drvdata(&dev->dev, NULL); + dev_set_drvdata(&op->dev, NULL); return 0; } -- cgit v1.2.3