diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-12-29 00:01:32 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-31 17:06:05 -0500 |
commit | e3a411a3dfc1d633504aa63efab32b7e00318454 (patch) | |
tree | 2ba6117448edd7056c8fa48cc6a696ae73a6c21a /drivers/serial/sunsab.c | |
parent | 6fc5bae797a6632bbccdd49a1b6a96121368a4b9 (diff) |
[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 <davem@davemloft.net>
Diffstat (limited to 'drivers/serial/sunsab.c')
-rw-r--r-- | drivers/serial/sunsab.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 493d5bbb661b..145d6236954b 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, | |||
1037 | err = request_irq(up->port.irq, sunsab_interrupt, | 1037 | err = request_irq(up->port.irq, sunsab_interrupt, |
1038 | IRQF_SHARED, "sab", up); | 1038 | IRQF_SHARED, "sab", up); |
1039 | if (err) { | 1039 | if (err) { |
1040 | of_iounmap(up->port.membase, | 1040 | of_iounmap(&op->resource[0], |
1041 | up->port.membase, | ||
1041 | sizeof(union sab82532_async_regs)); | 1042 | sizeof(union sab82532_async_regs)); |
1042 | return err; | 1043 | return err; |
1043 | } | 1044 | } |
@@ -1064,7 +1065,8 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * | |||
1064 | sizeof(union sab82532_async_regs), | 1065 | sizeof(union sab82532_async_regs), |
1065 | (inst * 2) + 1); | 1066 | (inst * 2) + 1); |
1066 | if (err) { | 1067 | if (err) { |
1067 | of_iounmap(up[0].port.membase, | 1068 | of_iounmap(&op->resource[0], |
1069 | up[0].port.membase, | ||
1068 | sizeof(union sab82532_async_regs)); | 1070 | sizeof(union sab82532_async_regs)); |
1069 | free_irq(up[0].port.irq, &up[0]); | 1071 | free_irq(up[0].port.irq, &up[0]); |
1070 | return err; | 1072 | return err; |
@@ -1082,10 +1084,13 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * | |||
1082 | 1084 | ||
1083 | static void __devexit sab_remove_one(struct uart_sunsab_port *up) | 1085 | static void __devexit sab_remove_one(struct uart_sunsab_port *up) |
1084 | { | 1086 | { |
1087 | struct of_device *op = to_of_device(up->port.dev); | ||
1088 | |||
1085 | uart_remove_one_port(&sunsab_reg, &up->port); | 1089 | uart_remove_one_port(&sunsab_reg, &up->port); |
1086 | if (!(up->port.line & 1)) | 1090 | if (!(up->port.line & 1)) |
1087 | free_irq(up->port.irq, up); | 1091 | free_irq(up->port.irq, up); |
1088 | of_iounmap(up->port.membase, | 1092 | of_iounmap(&op->resource[0], |
1093 | up->port.membase, | ||
1089 | sizeof(union sab82532_async_regs)); | 1094 | sizeof(union sab82532_async_regs)); |
1090 | } | 1095 | } |
1091 | 1096 | ||