diff options
| -rw-r--r-- | arch/sparc/kernel/ioport.c | 2 | ||||
| -rw-r--r-- | arch/sparc64/kernel/of_device.c | 7 | ||||
| -rw-r--r-- | drivers/input/serio/i8042-sparcio.h | 6 | ||||
| -rw-r--r-- | drivers/serial/sunsab.c | 11 | ||||
| -rw-r--r-- | drivers/serial/sunsu.c | 10 | ||||
| -rw-r--r-- | drivers/serial/sunzilog.c | 14 | ||||
| -rw-r--r-- | drivers/video/bw2.c | 18 | ||||
| -rw-r--r-- | drivers/video/cg14.c | 28 | ||||
| -rw-r--r-- | drivers/video/cg3.c | 22 | ||||
| -rw-r--r-- | drivers/video/cg6.c | 33 | ||||
| -rw-r--r-- | drivers/video/ffb.c | 25 | ||||
| -rw-r--r-- | drivers/video/leo.c | 29 | ||||
| -rw-r--r-- | drivers/video/p9100.c | 25 | ||||
| -rw-r--r-- | drivers/video/tcx.c | 33 | ||||
| -rw-r--r-- | include/asm-sparc/of_device.h | 2 | ||||
| -rw-r--r-- | include/asm-sparc64/of_device.h | 2 |
16 files changed, 155 insertions, 112 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 00a39760877b..987ec6782f99 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
| @@ -153,7 +153,7 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, | |||
| 153 | } | 153 | } |
| 154 | EXPORT_SYMBOL(of_ioremap); | 154 | EXPORT_SYMBOL(of_ioremap); |
| 155 | 155 | ||
| 156 | void of_iounmap(void __iomem *base, unsigned long size) | 156 | void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) |
| 157 | { | 157 | { |
| 158 | iounmap(base); | 158 | iounmap(base); |
| 159 | } | 159 | } |
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index cec0eceae552..b0f3e0082a0d 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
| @@ -144,9 +144,12 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned lo | |||
| 144 | } | 144 | } |
| 145 | EXPORT_SYMBOL(of_ioremap); | 145 | EXPORT_SYMBOL(of_ioremap); |
| 146 | 146 | ||
| 147 | void of_iounmap(void __iomem *base, unsigned long size) | 147 | void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) |
| 148 | { | 148 | { |
| 149 | release_region((unsigned long) base, size); | 149 | if (res->flags & IORESOURCE_MEM) |
| 150 | release_mem_region((unsigned long) base, size); | ||
| 151 | else | ||
| 152 | release_region((unsigned long) base, size); | ||
| 150 | } | 153 | } |
| 151 | EXPORT_SYMBOL(of_iounmap); | 154 | EXPORT_SYMBOL(of_iounmap); |
| 152 | 155 | ||
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h index 54adba2d8ed5..d9ca55891cd7 100644 --- a/drivers/input/serio/i8042-sparcio.h +++ b/drivers/input/serio/i8042-sparcio.h | |||
| @@ -16,6 +16,7 @@ static int i8042_aux_irq = -1; | |||
| 16 | #define I8042_MUX_PHYS_DESC "sparcps2/serio%d" | 16 | #define I8042_MUX_PHYS_DESC "sparcps2/serio%d" |
| 17 | 17 | ||
| 18 | static void __iomem *kbd_iobase; | 18 | static void __iomem *kbd_iobase; |
| 19 | static struct resource *kbd_res; | ||
| 19 | 20 | ||
| 20 | #define I8042_COMMAND_REG (kbd_iobase + 0x64UL) | 21 | #define I8042_COMMAND_REG (kbd_iobase + 0x64UL) |
| 21 | #define I8042_DATA_REG (kbd_iobase + 0x60UL) | 22 | #define I8042_DATA_REG (kbd_iobase + 0x60UL) |
| @@ -60,6 +61,7 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev | |||
| 60 | i8042_kbd_irq = irq; | 61 | i8042_kbd_irq = irq; |
| 61 | kbd_iobase = of_ioremap(&kbd->resource[0], | 62 | kbd_iobase = of_ioremap(&kbd->resource[0], |
| 62 | 0, 8, "kbd"); | 63 | 0, 8, "kbd"); |
| 64 | kbd_res = &kbd->resource[0]; | ||
| 63 | } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || | 65 | } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || |
| 64 | !strcmp(dp->name, OBP_PS2MS_NAME2)) { | 66 | !strcmp(dp->name, OBP_PS2MS_NAME2)) { |
| 65 | struct of_device *ms = of_find_device_by_node(dp); | 67 | struct of_device *ms = of_find_device_by_node(dp); |
| @@ -77,7 +79,7 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev | |||
| 77 | 79 | ||
| 78 | static int __devexit sparc_i8042_remove(struct of_device *op) | 80 | static int __devexit sparc_i8042_remove(struct of_device *op) |
| 79 | { | 81 | { |
| 80 | of_iounmap(kbd_iobase, 8); | 82 | of_iounmap(kbd_res, kbd_iobase, 8); |
| 81 | 83 | ||
| 82 | return 0; | 84 | return 0; |
| 83 | } | 85 | } |
| @@ -119,7 +121,7 @@ static int __init i8042_platform_init(void) | |||
| 119 | if (i8042_kbd_irq == -1 || | 121 | if (i8042_kbd_irq == -1 || |
| 120 | i8042_aux_irq == -1) { | 122 | i8042_aux_irq == -1) { |
| 121 | if (kbd_iobase) { | 123 | if (kbd_iobase) { |
| 122 | of_iounmap(kbd_iobase, 8); | 124 | of_iounmap(kbd_res, kbd_iobase, 8); |
| 123 | kbd_iobase = (void __iomem *) NULL; | 125 | kbd_iobase = (void __iomem *) NULL; |
| 124 | } | 126 | } |
| 125 | return -ENODEV; | 127 | return -ENODEV; |
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 | ||
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 564592b2b2ba..3ec3df21816b 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
| @@ -1480,13 +1480,13 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m | |||
| 1480 | return 0; | 1480 | return 0; |
| 1481 | 1481 | ||
| 1482 | out_unmap: | 1482 | out_unmap: |
| 1483 | of_iounmap(up->port.membase, up->reg_size); | 1483 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); |
| 1484 | return err; | 1484 | return err; |
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| 1487 | static int __devexit su_remove(struct of_device *dev) | 1487 | static int __devexit su_remove(struct of_device *op) |
| 1488 | { | 1488 | { |
| 1489 | struct uart_sunsu_port *up = dev_get_drvdata(&dev->dev);; | 1489 | struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); |
| 1490 | 1490 | ||
| 1491 | if (up->su_type == SU_PORT_MS || | 1491 | if (up->su_type == SU_PORT_MS || |
| 1492 | up->su_type == SU_PORT_KBD) { | 1492 | up->su_type == SU_PORT_KBD) { |
| @@ -1499,9 +1499,9 @@ static int __devexit su_remove(struct of_device *dev) | |||
| 1499 | } | 1499 | } |
| 1500 | 1500 | ||
| 1501 | if (up->port.membase) | 1501 | if (up->port.membase) |
| 1502 | of_iounmap(up->port.membase, up->reg_size); | 1502 | of_iounmap(&op->resource[0], up->port.membase, up->reg_size); |
| 1503 | 1503 | ||
| 1504 | dev_set_drvdata(&dev->dev, NULL); | 1504 | dev_set_drvdata(&op->dev, NULL); |
| 1505 | 1505 | ||
| 1506 | return 0; | 1506 | return 0; |
| 1507 | } | 1507 | } |
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 75de919a9471..244f796dc625 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 | |||
| 1379 | if (!keyboard_mouse) { | 1379 | if (!keyboard_mouse) { |
| 1380 | err = uart_add_one_port(&sunzilog_reg, &up[0].port); | 1380 | err = uart_add_one_port(&sunzilog_reg, &up[0].port); |
| 1381 | if (err) { | 1381 | if (err) { |
| 1382 | of_iounmap(rp, sizeof(struct zilog_layout)); | 1382 | of_iounmap(&op->resource[0], |
| 1383 | rp, sizeof(struct zilog_layout)); | ||
| 1383 | return err; | 1384 | return err; |
