aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/hid-lgff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input/hid-lgff.c')
-rw-r--r--drivers/usb/input/hid-lgff.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c
index 0d7404bab92f..0c4c77aa31ea 100644
--- a/drivers/usb/input/hid-lgff.c
+++ b/drivers/usb/input/hid-lgff.c
@@ -94,7 +94,7 @@ struct lgff_device {
94 isn't really necessary */ 94 isn't really necessary */
95 95
96 unsigned long flags[1]; /* Contains various information about the 96 unsigned long flags[1]; /* Contains various information about the
97 state of the driver for this device */ 97 state of the driver for this device */
98 98
99 struct timer_list timer; 99 struct timer_list timer;
100}; 100};
@@ -234,7 +234,7 @@ static struct hid_report* hid_lgff_duplicate_report(struct hid_report* report)
234 kfree(ret); 234 kfree(ret);
235 return NULL; 235 return NULL;
236 } 236 }
237 memset(ret->field[0]->value, 0, sizeof(s32[8])); 237 memset(ret->field[0]->value, 0, sizeof(s32[8]));
238 238
239 return ret; 239 return ret;
240} 240}
@@ -295,11 +295,11 @@ static int hid_lgff_event(struct hid_device *hid, struct input_dev* input,
295 unsigned long flags; 295 unsigned long flags;
296 296
297 if (type != EV_FF) return -EINVAL; 297 if (type != EV_FF) return -EINVAL;
298 if (!LGFF_CHECK_OWNERSHIP(code, lgff)) return -EACCES; 298 if (!LGFF_CHECK_OWNERSHIP(code, lgff)) return -EACCES;
299 if (value < 0) return -EINVAL; 299 if (value < 0) return -EINVAL;
300 300
301 spin_lock_irqsave(&lgff->lock, flags); 301 spin_lock_irqsave(&lgff->lock, flags);
302 302
303 if (value > 0) { 303 if (value > 0) {
304 if (test_bit(EFFECT_STARTED, effect->flags)) { 304 if (test_bit(EFFECT_STARTED, effect->flags)) {
305 spin_unlock_irqrestore(&lgff->lock, flags); 305 spin_unlock_irqrestore(&lgff->lock, flags);
@@ -345,7 +345,7 @@ static int hid_lgff_flush(struct input_dev *dev, struct file *file)
345 and perform ioctls on the same fd all at the same time */ 345 and perform ioctls on the same fd all at the same time */
346 if ( current->pid == lgff->effects[i].owner 346 if ( current->pid == lgff->effects[i].owner
347 && test_bit(EFFECT_USED, lgff->effects[i].flags)) { 347 && test_bit(EFFECT_USED, lgff->effects[i].flags)) {
348 348
349 if (hid_lgff_erase(dev, i)) 349 if (hid_lgff_erase(dev, i))
350 warn("erase effect %d failed", i); 350 warn("erase effect %d failed", i);
351 } 351 }
@@ -378,7 +378,7 @@ static int hid_lgff_upload_effect(struct input_dev* input,
378 struct lgff_effect new; 378 struct lgff_effect new;
379 int id; 379 int id;
380 unsigned long flags; 380 unsigned long flags;
381 381
382 dbg("ioctl rumble"); 382 dbg("ioctl rumble");
383 383
384 if (!test_bit(effect->type, input->ffbit)) return -EINVAL; 384 if (!test_bit(effect->type, input->ffbit)) return -EINVAL;
@@ -441,7 +441,7 @@ static void hid_lgff_timer(unsigned long timer_data)
441 441
442 spin_lock_irqsave(&lgff->lock, flags); 442 spin_lock_irqsave(&lgff->lock, flags);
443 443
444 for (i=0; i<LGFF_EFFECTS; ++i) { 444 for (i=0; i<LGFF_EFFECTS; ++i) {
445 struct lgff_effect* effect = lgff->effects +i; 445 struct lgff_effect* effect = lgff->effects +i;
446 446
447 if (test_bit(EFFECT_PLAYING, effect->flags)) { 447 if (test_bit(EFFECT_PLAYING, effect->flags)) {
@@ -491,7 +491,7 @@ static void hid_lgff_timer(unsigned long timer_data)
491 set_bit(EFFECT_PLAYING, lgff->effects[i].flags); 491 set_bit(EFFECT_PLAYING, lgff->effects[i].flags);
492 } 492 }
493 } 493 }
494 } 494 }
495 495
496#define CLAMP(x) if (x < 0) x = 0; if (x > 0xff) x = 0xff 496#define CLAMP(x) if (x < 0) x = 0; if (x > 0xff) x = 0xff
497 497
@@ -524,5 +524,5 @@ static void hid_lgff_timer(unsigned long timer_data)
524 add_timer(&lgff->timer); 524 add_timer(&lgff->timer);
525 } 525 }
526 526
527 spin_unlock_irqrestore(&lgff->lock, flags); 527 spin_unlock_irqrestore(&lgff->lock, flags);
528} 528}