Skip to content

Commit 625cbe4

Browse files
author
Peter Ujfalusi
committed
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>
1 parent 0f962ae commit 625cbe4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎drivers/input/misc/twl6040-vibra.c‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct vibra_info {
4747
struct workqueue_struct *workqueue;
4848
struct work_struct play_work;
4949
struct mutex mutex;
50+
int irq;
5051

5152
bool enabled;
5253
int weak_speed;
@@ -277,6 +278,13 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
277278
goto err_kzalloc;
278279
}
279280

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+
280288
mutex_init(&info->mutex);
281289

282290
info->input_dev = input_allocate_device();
@@ -308,9 +316,8 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
308316

309317
platform_set_drvdata(pdev, info);
310318

311-
ret = twl6040_request_irq(info->twl6040, TWL6040_IRQ_VIB,
312-
twl6040_vib_irq_handler, 0,
313-
"twl6040_irq_vib", info);
319+
ret = request_threaded_irq(info->irq, NULL, twl6040_vib_irq_handler, 0,
320+
"twl6040_irq_vib", info);
314321
if (ret) {
315322
dev_err(info->dev, "VIB IRQ request failed: %d\n", ret);
316323
goto err_irq;
@@ -360,7 +367,7 @@ static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
360367
err_voltage:
361368
regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies);
362369
err_regulator:
363-
twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info);
370+
free_irq(info->irq, info);
364371
err_irq:
365372
input_unregister_device(info->input_dev);
366373
info->input_dev = NULL;
@@ -379,7 +386,7 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev)
379386
struct vibra_info *info = platform_get_drvdata(pdev);
380387

381388
input_unregister_device(info->input_dev);
382-
twl6040_free_irq(info->twl6040, TWL6040_IRQ_VIB, info);
389+
free_irq(info->irq, info);
383390
regulator_bulk_free(ARRAY_SIZE(info->supplies), info->supplies);
384391
destroy_workqueue(info->workqueue);
385392
kfree(info);

0 commit comments

Comments
 (0)