aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/inport.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:30 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:30 -0400
commit3108d42de4da0823feb37a55db62acdc01554625 (patch)
tree5c46888f791191d7595f0a4f809bc01062e55d75 /drivers/input/mouse/inport.c
parent0fbf87caf70acec0c435233fbc39c7bd0aca3ca6 (diff)
Input: remove user counters from drivers/input/mouse since input
core takes care of calling open and close methods only when needed. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/inport.c')
-rw-r--r--drivers/input/mouse/inport.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
index ceeb2d66762c..1f62c0134010 100644
--- a/drivers/input/mouse/inport.c
+++ b/drivers/input/mouse/inport.c
@@ -87,29 +87,23 @@ MODULE_PARM_DESC(irq, "IRQ number (5=default)");
87 87
88__obsolete_setup("inport_irq="); 88__obsolete_setup("inport_irq=");
89 89
90static int inport_used;
91
92static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs); 90static irqreturn_t inport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
93 91
94static int inport_open(struct input_dev *dev) 92static int inport_open(struct input_dev *dev)
95{ 93{
96 if (!inport_used++) { 94 if (request_irq(inport_irq, inport_interrupt, 0, "inport", NULL))
97 if (request_irq(inport_irq, inport_interrupt, 0, "inport", NULL)) 95 return -EBUSY;
98 return -EBUSY; 96 outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
99 outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); 97 outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
100 outb(INPORT_MODE_IRQ | INPORT_MODE_BASE, INPORT_DATA_PORT);
101 }
102 98
103 return 0; 99 return 0;
104} 100}
105 101
106static void inport_close(struct input_dev *dev) 102static void inport_close(struct input_dev *dev)
107{ 103{
108 if (!--inport_used) { 104 outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
109 outb(INPORT_REG_MODE, INPORT_CONTROL_PORT); 105 outb(INPORT_MODE_BASE, INPORT_DATA_PORT);
110 outb(INPORT_MODE_BASE, INPORT_DATA_PORT); 106 free_irq(inport_irq, NULL);
111 free_irq(inport_irq, NULL);
112 }
113} 107}
114 108
115static struct input_dev inport_dev = { 109static struct input_dev inport_dev = {