aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/ff-memless.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-30 02:33:07 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-12-01 02:10:26 -0500
commitda0c490115de026618a7fdcd886602da44392a50 (patch)
treeb61dae8d525fa765151adb8df5456a1e9880a773 /drivers/input/ff-memless.c
parent4eb3c30b2e034b673df3e8f21b497e39f3911a02 (diff)
Input: use pr_fmt and pr_<level>
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/ff-memless.c')
-rw-r--r--drivers/input/ff-memless.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index 1d881c96ba8f..117a59aaa70e 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -23,7 +23,7 @@
23 23
24/* #define DEBUG */ 24/* #define DEBUG */
25 25
26#define debug(format, arg...) pr_debug("ff-memless: " format "\n", ## arg) 26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27 27
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/input.h> 29#include <linux/input.h>
@@ -129,7 +129,7 @@ static void ml_schedule_timer(struct ml_device *ml)
129 int events = 0; 129 int events = 0;
130 int i; 130 int i;
131 131
132 debug("calculating next timer"); 132 pr_debug("calculating next timer\n");
133 133
134 for (i = 0; i < FF_MEMLESS_EFFECTS; i++) { 134 for (i = 0; i < FF_MEMLESS_EFFECTS; i++) {
135 135
@@ -149,10 +149,10 @@ static void ml_schedule_timer(struct ml_device *ml)
149 } 149 }
150 150
151 if (!events) { 151 if (!events) {
152 debug("no actions"); 152 pr_debug("no actions\n");
153 del_timer(&ml->timer); 153 del_timer(&ml->timer);
154 } else { 154 } else {
155 debug("timer set"); 155 pr_debug("timer set\n");
156 mod_timer(&ml->timer, earliest); 156 mod_timer(&ml->timer, earliest);
157 } 157 }
158} 158}
@@ -173,8 +173,8 @@ static int apply_envelope(struct ml_effect_state *state, int value,
173 if (envelope->attack_length && 173 if (envelope->attack_length &&
174 time_before(now, 174 time_before(now,
175 state->play_at + msecs_to_jiffies(envelope->attack_length))) { 175 state->play_at + msecs_to_jiffies(envelope->attack_length))) {
176 debug("value = 0x%x, attack_level = 0x%x", value, 176 pr_debug("value = 0x%x, attack_level = 0x%x\n",
177 envelope->attack_level); 177 value, envelope->attack_level);
178 time_from_level = jiffies_to_msecs(now - state->play_at); 178 time_from_level = jiffies_to_msecs(now - state->play_at);
179 time_of_envelope = envelope->attack_length; 179 time_of_envelope = envelope->attack_length;
180 envelope_level = min_t(__s16, envelope->attack_level, 0x7fff); 180 envelope_level = min_t(__s16, envelope->attack_level, 0x7fff);
@@ -191,13 +191,13 @@ static int apply_envelope(struct ml_effect_state *state, int value,
191 191
192 difference = abs(value) - envelope_level; 192 difference = abs(value) - envelope_level;
193 193
194 debug("difference = %d", difference); 194 pr_debug("difference = %d\n", difference);
195 debug("time_from_level = 0x%x", time_from_level); 195 pr_debug("time_from_level = 0x%x\n", time_from_level);
196 debug("time_of_envelope = 0x%x", time_of_envelope); 196 pr_debug("time_of_envelope = 0x%x\n", time_of_envelope);
197 197
198 difference = difference * time_from_level / time_of_envelope; 198 difference = difference * time_from_level / time_of_envelope;
199 199
200 debug("difference = %d", difference); 200 pr_debug("difference = %d\n", difference);
201 201
202 return value < 0 ? 202 return value < 0 ?
203 -(difference + envelope_level) : (difference + envelope_level); 203 -(difference + envelope_level) : (difference + envelope_level);
@@ -215,8 +215,7 @@ static int get_compatible_type(struct ff_device *ff, int effect_type)
215 if (effect_type == FF_PERIODIC && test_bit(FF_RUMBLE, ff->ffbit)) 215 if (effect_type == FF_PERIODIC && test_bit(FF_RUMBLE, ff->ffbit))
216 return FF_RUMBLE; 216 return FF_RUMBLE;
217 217
218 printk(KERN_ERR 218 pr_err("invalid type in get_compatible_type()\n");
219 "ff-memless: invalid type in get_compatible_type()\n");
220 219
221 return 0; 220 return 0;
222} 221}
@@ -312,7 +311,7 @@ static void ml_combine_effects(struct ff_effect *effect,
312 break; 311 break;
313 312
314 default: 313 default:
315 printk(KERN_ERR "ff-memless: invalid type in ml_combine_effects()\n"); 314 pr_err("invalid type in ml_combine_effects()\n");
316 break; 315 break;
317 } 316 }
318 317
@@ -406,7 +405,7 @@ static void ml_effect_timer(unsigned long timer_data)
406 struct ml_device *ml = dev->ff->private; 405 struct ml_device *ml = dev->ff->private;
407 unsigned long flags; 406 unsigned long flags;
408 407
409 debug("timer: updating effects"); 408 pr_debug("timer: updating effects\n");
410 409
411 spin_lock_irqsave(&dev->event_lock, flags); 410 spin_lock_irqsave(&dev->event_lock, flags);
412 ml_play_effects(ml); 411 ml_play_effects(ml);
@@ -438,7 +437,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
438 struct ml_effect_state *state = &ml->states[effect_id]; 437 struct ml_effect_state *state = &ml->states[effect_id];
439 438
440 if (value > 0) { 439 if (value > 0) {
441 debug("initiated play"); 440 pr_debug("initiated play\n");
442 441
443 __set_bit(FF_EFFECT_STARTED, &state->flags); 442 __set_bit(FF_EFFECT_STARTED, &state->flags);
444 state->count = value; 443 state->count = value;
@@ -449,7 +448,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
449 state->adj_at = state->play_at; 448 state->adj_at = state->play_at;
450 449
451 } else { 450 } else {
452 debug("initiated stop"); 451 pr_debug("initiated stop\n");
453 452
454 if (test_bit(FF_EFFECT_PLAYING, &state->flags)) 453 if (test_bit(FF_EFFECT_PLAYING, &state->flags))
455 __set_bit(FF_EFFECT_ABORTING, &state->flags); 454 __set_bit(FF_EFFECT_ABORTING, &state->flags);