X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Finput%2Fati_remote.c;h=07c8c0e665dd301ced352c6f20e0bb68a0034b98;hb=6c763eb9ead86c612492b59287b36c0dcf7d09b1;hp=9a2a47db9494d62e595865ac02038e6ce9a04320;hpb=596c96ba06e5d56e72451e02f93f4e15e17458df;p=linux-2.6-omap-h63xx.git diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index 9a2a47db949..07c8c0e665d 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c @@ -92,10 +92,9 @@ #include #include #include -#include -#include -#include +#include #include +#include /* * Module and Version Information, Module Parameters @@ -146,7 +145,7 @@ static char init1[] = { 0x01, 0x00, 0x20, 0x14 }; static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 }; /* Acceleration curve for directional control pad */ -static char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; +static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; /* Duplicate event filtering time. * Sequential, identical KIND_FILTERED inputs with less than @@ -158,8 +157,6 @@ static char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; */ #define FILTER_TIME (HZ / 20) -static DECLARE_MUTEX(disconnect_sem); - struct ati_remote { struct input_dev *idev; struct usb_device *udev; @@ -197,7 +194,7 @@ struct ati_remote { #define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/ /* Translation table from hardware messages to input events. */ -static struct { +static const struct { short kind; unsigned char data1, data2; int type; @@ -295,7 +292,6 @@ static void ati_remote_disconnect (struct usb_interface *interface); /* usb specific object to register with the usb subsystem */ static struct usb_driver ati_remote_driver = { - .owner = THIS_MODULE, .name = "ati_remote", .probe = ati_remote_probe, .disconnect = ati_remote_disconnect, @@ -472,7 +468,7 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) /* Filter duplicate events which happen "too close" together. */ if ((ati_remote->old_data[0] == data[1]) && (ati_remote->old_data[1] == data[2]) && - ((ati_remote->old_jiffies + FILTER_TIME) > jiffies)) { + time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) { ati_remote->repeat_count++; } else { ati_remote->repeat_count = 0; @@ -507,16 +503,16 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs) * pad down, so we increase acceleration, ramping up over two seconds to * a maximum speed. The acceleration curve is #defined above. */ - if ((jiffies - ati_remote->old_jiffies) > (HZ >> 2)) { + if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) { acc = 1; ati_remote->acc_jiffies = jiffies; } - else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 3)) acc = accel[0]; - else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 2)) acc = accel[1]; - else if ((jiffies - ati_remote->acc_jiffies) < (HZ >> 1)) acc = accel[2]; - else if ((jiffies - ati_remote->acc_jiffies) < HZ ) acc = accel[3]; - else if ((jiffies - ati_remote->acc_jiffies) < HZ+(HZ>>1)) acc = accel[4]; - else if ((jiffies - ati_remote->acc_jiffies) < (HZ << 1)) acc = accel[5]; + else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3))) acc = accel[0]; + else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2))) acc = accel[1]; + else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1))) acc = accel[2]; + else if (time_before(jiffies, ati_remote->acc_jiffies + HZ)) acc = accel[3]; + else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4]; + else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1))) acc = accel[5]; else acc = accel[6]; input_regs(dev, regs);