X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Finput%2Fff-memless.c;h=bc4e40f3ede7303d97816a6cbf8588c8f22118d2;hb=16799c6a4d5156c6ee185b51b7586cca1aae0800;hp=eba18b6ac5e4dc3afe012436f62441f04675eaf9;hpb=706b75ddbe36d20d071424f9867385c319b67f8d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index eba18b6ac5e..bc4e40f3ede 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "fixp-arith.h" @@ -247,9 +247,9 @@ static void ml_combine_effects(struct ff_effect *effect, * in s8, this should be changed to something more generic */ effect->u.ramp.start_level = - max(min(effect->u.ramp.start_level + x, 0x7f), -0x80); + clamp_val(effect->u.ramp.start_level + x, -0x80, 0x7f); effect->u.ramp.end_level = - max(min(effect->u.ramp.end_level + y, 0x7f), -0x80); + clamp_val(effect->u.ramp.end_level + y, -0x80, 0x7f); break; case FF_RUMBLE: @@ -397,8 +397,9 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) { struct ml_device *ml = dev->ff->private; struct ml_effect_state *state = &ml->states[effect_id]; + unsigned long flags; - spin_lock_bh(&ml->timer_lock); + spin_lock_irqsave(&ml->timer_lock, flags); if (value > 0) { debug("initiated play"); @@ -424,7 +425,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) ml_play_effects(ml); } - spin_unlock_bh(&ml->timer_lock); + spin_unlock_irqrestore(&ml->timer_lock, flags); return 0; }