diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-04 12:50:02 -0400 |
---|---|---|
committer | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2011-07-07 07:23:21 -0400 |
commit | 625cbe46bc97a82dcd9254b5bc01c8520d78b227 (patch) | |
tree | 0a9e9c8b881a96920d820ae12b436eecbc3bd704 /drivers/input/misc/twl6040-vibra.c | |
parent | 0f962ae2dd8655f0800ff3c4b02d5f5a2ff3899e (diff) |
input: twl6040-vibra: Do not use wrapper for irq request
The twl6040_request_irq/free_irq inline functions are going
to be removed, so replace them with direct calls.
The irq number is provided by the core driver via resource.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc/twl6040-vibra.c')
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index dbf745ddfe50..c43002e7ec72 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
@@ -47,6 +47,7 @@ struct vibra_info { | |||
47 | struct workqueue_struct *workqueue; | 47 | struct workqueue_struct *workqueue; |
48 | struct work_struct play_work; | 48 | struct work_struct play_work; |
49 | struct mutex mutex; | 49 | struct mutex mutex; |
50 | int irq; | ||
50 | 51 | ||
51 | bool enabled; | 52 | bool enabled; |
52 | int weak_speed; | 53 | int weak_speed; |
@@ -277,6 +278,13 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) | |||
277 | goto err_kzalloc; | 278 | goto err_kzalloc; |
278 | } | 279 | } |
279 | 280 | ||
281 | info->irq = platform_get_irq(pdev, 0); | ||
282 | if (info->irq < 0) { | ||
283 | dev_err(info->dev, "invalid irq\n"); | ||
284 | ret = -EINVAL; | ||
285 | goto err_kzalloc; | ||
286 | } | ||
287 | |||
280 | mutex_init(&info->mutex); | 288 | mutex_init(&info->mutex); |
281 | 289 | ||
282 | info->input_dev = input_allocate_device(); | 290 | info->input_dev = input_allocate_device(); |
@@ -308,9 +316,8 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) | |||
308 | 316 | ||
309 | platform_set_drvdata(pdev, info); | 317 | platform_set_drvdata(pdev, info); |
310 | 318 | ||
311 | ret = twl6040_request_irq(info->twl6040, TWL6040_IRQ_VIB, | 319 | ret = request_threaded_irq(info->irq, NULL, twl6040_vib_irq_handler, 0, |
312 | twl6040_vib_irq_handler, 0, | 320 | "twl6040_irq_vib", info); |
313 | "twl6040_irq_vib", info); | ||
314 | if (ret) { | 321 | if (ret) { |
315 | dev_err(info->dev, "VIB IRQ request failed: %d\n", ret); | 322 | dev_err(info->dev, "VIB IRQ request failed: %d\n", ret); |
316 | goto err_irq; | 323 | goto err_irq; |
@@ -360,7 +367,7 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev) | |||
360 | err_voltage: | 367 | err_voltage: |
361 | regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); | 368 | regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); |
362 | err_regulator: | 369 | err_regulator: |
363 | twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); | 370 | free_irq(info->irq, info); |
364 | err_irq: | 371 | err_irq: |
365 | input_unregister_device(info->input_dev); | 372 | input_unregister_device(info->input_dev); |
366 | info->input_dev = NULL; | 373 | info->input_dev = NULL; |
@@ -379,7 +386,7 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev) | |||
379 | struct vibra_info *info = platform_get_drvdata(pdev); | 386 | struct vibra_info *info = platform_get_drvdata(pdev); |
380 | 387 | ||
381 | input_unregister_device(info->input_dev); | 388 | input_unregister_device(info->input_dev); |
382 | twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); | 389 | free_irq(info->irq, info); |
383 | regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); | 390 | regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); |
384 | destroy_workqueue(info->workqueue); | 391 | destroy_workqueue(info->workqueue); |
385 | kfree(info); | 392 | kfree(info); |