maceps2.c (1cb0aa88179b7a71c240529e9d781d7bbb43d2e8) | maceps2.c (5298cc4cc753bbe4c530b41341834f6ef3344d0d) |
---|---|
1/* 2 * SGI O2 MACE PS2 controller driver for linux 3 * 4 * Copyright (C) 2002 Vivien Chappelier 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation --- 102 unchanged lines hidden (view full) --- 111 struct maceps2_data *data = (struct maceps2_data *)dev->port_data; 112 113 data->port->control = PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET; 114 udelay(100); 115 free_irq(data->irq, dev); 116} 117 118 | 1/* 2 * SGI O2 MACE PS2 controller driver for linux 3 * 4 * Copyright (C) 2002 Vivien Chappelier 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation --- 102 unchanged lines hidden (view full) --- 111 struct maceps2_data *data = (struct maceps2_data *)dev->port_data; 112 113 data->port->control = PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET; 114 udelay(100); 115 free_irq(data->irq, dev); 116} 117 118 |
119static struct serio * __devinit maceps2_allocate_port(int idx) | 119static struct serio *maceps2_allocate_port(int idx) |
120{ 121 struct serio *serio; 122 123 serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 124 if (serio) { 125 serio->id.type = SERIO_8042; 126 serio->write = maceps2_write; 127 serio->open = maceps2_open; 128 serio->close = maceps2_close; 129 snprintf(serio->name, sizeof(serio->name), "MACE PS/2 port%d", idx); 130 snprintf(serio->phys, sizeof(serio->phys), "mace/serio%d", idx); 131 serio->port_data = &port_data[idx]; 132 serio->dev.parent = &maceps2_device->dev; 133 } 134 135 return serio; 136} 137 | 120{ 121 struct serio *serio; 122 123 serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 124 if (serio) { 125 serio->id.type = SERIO_8042; 126 serio->write = maceps2_write; 127 serio->open = maceps2_open; 128 serio->close = maceps2_close; 129 snprintf(serio->name, sizeof(serio->name), "MACE PS/2 port%d", idx); 130 snprintf(serio->phys, sizeof(serio->phys), "mace/serio%d", idx); 131 serio->port_data = &port_data[idx]; 132 serio->dev.parent = &maceps2_device->dev; 133 } 134 135 return serio; 136} 137 |
138static int __devinit maceps2_probe(struct platform_device *dev) | 138static int maceps2_probe(struct platform_device *dev) |
139{ 140 maceps2_port[0] = maceps2_allocate_port(0); 141 maceps2_port[1] = maceps2_allocate_port(1); 142 if (!maceps2_port[0] || !maceps2_port[1]) { 143 kfree(maceps2_port[0]); 144 kfree(maceps2_port[1]); 145 return -ENOMEM; 146 } --- 64 unchanged lines hidden --- | 139{ 140 maceps2_port[0] = maceps2_allocate_port(0); 141 maceps2_port[1] = maceps2_allocate_port(1); 142 if (!maceps2_port[0] || !maceps2_port[1]) { 143 kfree(maceps2_port[0]); 144 kfree(maceps2_port[1]); 145 return -ENOMEM; 146 } --- 64 unchanged lines hidden --- |