diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-04 09:59:47 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-04 09:59:47 -0500 |
| commit | 5cb2faa6ede7ada9cb2bffc832c4ce60f53d6834 (patch) | |
| tree | 7b72b66081d042a41dc822575503133364857ce2 /drivers/input/ff-core.c | |
| parent | e0ee98513d1a2e24d2ddbdecf4216bcca29d1158 (diff) | |
| parent | 6060e8df517847bf445ebc61de7d4d9c7faae990 (diff) | |
Merge branch 'pending-misc' (early part) into devel
Diffstat (limited to 'drivers/input/ff-core.c')
| -rw-r--r-- | drivers/input/ff-core.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index 72c63e5dd630..38df81fcdc3a 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c | |||
| @@ -337,16 +337,16 @@ int input_ff_create(struct input_dev *dev, int max_effects) | |||
| 337 | dev->ff = ff; | 337 | dev->ff = ff; |
| 338 | dev->flush = flush_effects; | 338 | dev->flush = flush_effects; |
| 339 | dev->event = input_ff_event; | 339 | dev->event = input_ff_event; |
| 340 | set_bit(EV_FF, dev->evbit); | 340 | __set_bit(EV_FF, dev->evbit); |
| 341 | 341 | ||
| 342 | /* Copy "true" bits into ff device bitmap */ | 342 | /* Copy "true" bits into ff device bitmap */ |
| 343 | for (i = 0; i <= FF_MAX; i++) | 343 | for (i = 0; i <= FF_MAX; i++) |
| 344 | if (test_bit(i, dev->ffbit)) | 344 | if (test_bit(i, dev->ffbit)) |
| 345 | set_bit(i, ff->ffbit); | 345 | __set_bit(i, ff->ffbit); |
| 346 | 346 | ||
| 347 | /* we can emulate RUMBLE with periodic effects */ | 347 | /* we can emulate RUMBLE with periodic effects */ |
| 348 | if (test_bit(FF_PERIODIC, ff->ffbit)) | 348 | if (test_bit(FF_PERIODIC, ff->ffbit)) |
| 349 | set_bit(FF_RUMBLE, dev->ffbit); | 349 | __set_bit(FF_RUMBLE, dev->ffbit); |
| 350 | 350 | ||
| 351 | return 0; | 351 | return 0; |
| 352 | } | 352 | } |
| @@ -362,12 +362,14 @@ EXPORT_SYMBOL_GPL(input_ff_create); | |||
| 362 | */ | 362 | */ |
| 363 | void input_ff_destroy(struct input_dev *dev) | 363 | void input_ff_destroy(struct input_dev *dev) |
| 364 | { | 364 | { |
| 365 | clear_bit(EV_FF, dev->evbit); | 365 | struct ff_device *ff = dev->ff; |
| 366 | if (dev->ff) { | 366 | |
| 367 | if (dev->ff->destroy) | 367 | __clear_bit(EV_FF, dev->evbit); |
| 368 | dev->ff->destroy(dev->ff); | 368 | if (ff) { |
| 369 | kfree(dev->ff->private); | 369 | if (ff->destroy) |
| 370 | kfree(dev->ff); | 370 | ff->destroy(ff); |
| 371 | kfree(ff->private); | ||
| 372 | kfree(ff); | ||
| 371 | dev->ff = NULL; | 373 | dev->ff = NULL; |
| 372 | } | 374 | } |
| 373 | } | 375 | } |
