Commit 6b728a65 authored by Gabriel Devenyi's avatar Gabriel Devenyi Committed by Vojtech Pavlik

input: Fix gameport.c - gameport was never closed after calibrating

parent 3ea1af42
...@@ -84,6 +84,7 @@ static int gameport_measure_speed(struct gameport *gameport) ...@@ -84,6 +84,7 @@ static int gameport_measure_speed(struct gameport *gameport)
if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t; if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t;
} }
gameport_close(gameport);
return 59659 / (tx < 1 ? 1 : tx); return 59659 / (tx < 1 ? 1 : tx);
#else #else
...@@ -93,11 +94,10 @@ static int gameport_measure_speed(struct gameport *gameport) ...@@ -93,11 +94,10 @@ static int gameport_measure_speed(struct gameport *gameport)
j = jiffies; while (j == jiffies); j = jiffies; while (j == jiffies);
j = jiffies; while (j == jiffies) { t++; gameport_read(gameport); } j = jiffies; while (j == jiffies) { t++; gameport_read(gameport); }
gameport_close(gameport);
return t * HZ / 1000; return t * HZ / 1000;
#endif #endif
gameport_close(gameport);
} }
static void gameport_find_dev(struct gameport *gameport) static void gameport_find_dev(struct gameport *gameport)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment