aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/misc/twl6040-vibra.c17
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)
360err_voltage: 367err_voltage:
361 regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies); 368 regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies);
362err_regulator: 369err_regulator:
363 twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info); 370 free_irq(info->irq, info);
364err_irq: 371err_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);