Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98524
b: refs/heads/master
c: 656acd2
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Jun 30, 2008
1 parent 5bef98b commit 1d129f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bbff7e408a54cce88d26191191e8bcda2a60d55
refs/heads/master: 656acd2bbc4ce7f224de499ee255698701396c48
17 changes: 11 additions & 6 deletions trunk/drivers/input/ff-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
if (ret)
goto out;

spin_lock_irq(&dev->event_lock);
ff->effects[id] = *effect;
ff->effect_owners[id] = file;
spin_unlock_irq(&dev->event_lock);

out:
mutex_unlock(&ff->mutex);
Expand All @@ -189,16 +191,22 @@ static int erase_effect(struct input_dev *dev, int effect_id,
if (error)
return error;

spin_lock_irq(&dev->event_lock);
ff->playback(dev, effect_id, 0);
ff->effect_owners[effect_id] = NULL;
spin_unlock_irq(&dev->event_lock);

if (ff->erase) {
error = ff->erase(dev, effect_id);
if (error)
if (error) {
spin_lock_irq(&dev->event_lock);
ff->effect_owners[effect_id] = file;
spin_unlock_irq(&dev->event_lock);

return error;
}
}

ff->effect_owners[effect_id] = NULL;

return 0;
}

Expand Down Expand Up @@ -263,8 +271,6 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
if (type != EV_FF)
return 0;

mutex_lock(&ff->mutex);

switch (code) {
case FF_GAIN:
if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffff)
Expand All @@ -286,7 +292,6 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
break;
}

mutex_unlock(&ff->mutex);
return 0;
}
EXPORT_SYMBOL_GPL(input_ff_event);
Expand Down

0 comments on commit 1d129f2

Please sign in to comment.