aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/i8042-sparcio.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-12-29 00:01:32 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-31 17:06:05 -0500
commite3a411a3dfc1d633504aa63efab32b7e00318454 (patch)
tree2ba6117448edd7056c8fa48cc6a696ae73a6c21a /drivers/input/serio/i8042-sparcio.h
parent6fc5bae797a6632bbccdd49a1b6a96121368a4b9 (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/input/serio/i8042-sparcio.h')
-rw-r--r--drivers/input/serio/i8042-sparcio.h6
1 files changed, 4 insertions, 2 deletions
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
18static void __iomem *kbd_iobase; 18static void __iomem *kbd_iobase;
19static 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
78static int __devexit sparc_i8042_remove(struct of_device *op) 80static 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;