]> git.hungrycats.org Git - linux/commitdiff
input: Fix gameport.c - gameport was never closed after calibrating
authorGabriel Devenyi <devenyga@mcmaster.ca>
Fri, 20 Jun 2003 21:36:19 +0000 (14:36 -0700)
committerVojtech Pavlik <vojtech@kernel.bkbits.net>
Fri, 20 Jun 2003 21:36:19 +0000 (14:36 -0700)
drivers/input/gameport/gameport.c

index c26dea75fb70dd6661dc2701629a292e7a431a44..431883c5faa63bcadec988cb608d9c9430a3ba08 100644 (file)
@@ -84,6 +84,7 @@ static int gameport_measure_speed(struct gameport *gameport)
                if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t;
        }
 
+       gameport_close(gameport);
        return 59659 / (tx < 1 ? 1 : tx);
 
 #else
@@ -93,11 +94,10 @@ static int gameport_measure_speed(struct gameport *gameport)
        j = jiffies; while (j == jiffies);
        j = jiffies; while (j == jiffies) { t++; gameport_read(gameport); }
 
+       gameport_close(gameport);
        return t * HZ / 1000;
 
 #endif
-
-       gameport_close(gameport);
 }
 
 static void gameport_find_dev(struct gameport *gameport)